dmaengine: fix dmaengine_unmap failure
authorXuelin Shi <xuelin.shi@freescale.com>
Wed, 21 May 2014 21:02:37 +0000 (14:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jun 2014 17:28:25 +0000 (10:28 -0700)
commite411566e7dc68df11b817d154fb06e3fd761bc77
tree540d47cbdde033fe109c484ca532e55ac04fcaeb
parent6a1170d673278d51c8ceee2cb091d4baf4ef1ba2
dmaengine: fix dmaengine_unmap failure

commit c1f43dd9c20d85e66c4d77e284f64ac114abe3f8 upstream.

The count which is used to get_unmap_data maybe not the same as the
count computed in dmaengine_unmap which causes to free data in a
wrong pool.

This patch fixes this issue by keeping the map count with unmap_data
structure and use this count to get the pool.

Signed-off-by: Xuelin Shi <xuelin.shi@freescale.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/dmaengine.c
include/linux/dmaengine.h