dma: ste_dma40: don't dereference free:d descriptor
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 13 Feb 2014 09:39:01 +0000 (10:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 05:30:13 +0000 (21:30 -0800)
commit102544b7f13be7023db6f6447bf67cdafc239f24
tree68c006af0ef9e0d17a76c4f90d990a1594c9661c
parentf7caf9429406422de57e1b65284f47d8e5cbf7ae
dma: ste_dma40: don't dereference free:d descriptor

commit e9baa9d9d520fb0e24cca671e430689de2d4a4b2 upstream.

It appears that in the DMA40 driver the DMA tasklet will very
often dereference memory for a descriptor just free:d from the
DMA40 slab. Nothing happens because no other part of the driver
has yet had a chance to claim this memory, but it's really
nasty to dereference free:d memory, so let's check the flag
before the descriptor is free and store it in a bool variable.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/ste_dma40.c