dmaengine: sun4i: fix unsafe list iteration
authorEmilio López <emilio@elopez.com.ar>
Sun, 13 Sep 2015 20:15:53 +0000 (17:15 -0300)
committerVinod Koul <vinod.koul@intel.com>
Wed, 30 Sep 2015 06:47:22 +0000 (12:17 +0530)
commit40482e64b0b84388561b00b880eeca7000f72d38
tree7005e99333699a574292d34fee19dc10b16e0752
parent0b23a1ece9be2c3e04c3b8d3594a1ada1fa1ae50
dmaengine: sun4i: fix unsafe list iteration

Currently, sun4i_dma_free_contract iterates over lists and frees memory
as it goes through them, causing reads to recently freed memory to
be performed. Fix this by using the safe version of the iterator, so
freed memory is not referenced at all.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Emilio López <emilio@elopez.com.ar>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/sun4i-dma.c