re: dmaengine: sun4i: Add support for the DMA engine on sun[457]i SoCs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Emilio López,

The patch b096c1377d1e: "dmaengine: sun4i: Add support for the DMA
engine on sun[457]i SoCs" from Jul 26, 2015, leads to the following
Smatch warning:

	drivers/dma/sun4i-dma.c:605 sun4i_dma_free_contract()
	error: dereferencing freed memory 'promise'

drivers/dma/sun4i-dma.c
   599  static void sun4i_dma_free_contract(struct virt_dma_desc *vd)
   600  {
   601          struct sun4i_dma_contract *contract = to_sun4i_dma_contract(vd);
   602          struct sun4i_dma_promise *promise;
   603  
   604          /* Free all the demands and completed demands */
   605          list_for_each_entry(promise, &contract->demands, list)
   606                  kfree(promise);

Use list_for_each_entry_safe().

   607  
   608          list_for_each_entry(promise, &contract->completed_demands, list)
   609                  kfree(promise);


Here as well.

   610  
   611          kfree(contract);
   612  }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux