Joel Fernandes
2014-04-18 00:56:50 UTC
Free the vd (virt descriptor) after the callback is called. In EDMA driver
atleast which uses virt-dma, we make use of the desc during the callback and if
its dangerously freed before the callback is called. I also noticed this in
omap-dma dmaengine driver.
Cc: Vinod Koul <vinod.koul at intel.com>
Cc: Dan Williams <dan.j.williams at intel.com>
Cc: Russell King <rmk+kernel at arm.linux.org.uk>
Signed-off-by: Joel Fernandes <joelf at ti.com>
---
drivers/dma/virt-dma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/virt-dma.c b/drivers/dma/virt-dma.c
index 6f80432..98aeb7f 100644
--- a/drivers/dma/virt-dma.c
+++ b/drivers/dma/virt-dma.c
@@ -84,10 +84,10 @@ static void vchan_complete(unsigned long arg)
list_del(&vd->node);
- vc->desc_free(vd);
-
if (cb)
cb(cb_data);
+
+ vc->desc_free(vd);
}
}
atleast which uses virt-dma, we make use of the desc during the callback and if
its dangerously freed before the callback is called. I also noticed this in
omap-dma dmaengine driver.
Cc: Vinod Koul <vinod.koul at intel.com>
Cc: Dan Williams <dan.j.williams at intel.com>
Cc: Russell King <rmk+kernel at arm.linux.org.uk>
Signed-off-by: Joel Fernandes <joelf at ti.com>
---
drivers/dma/virt-dma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/virt-dma.c b/drivers/dma/virt-dma.c
index 6f80432..98aeb7f 100644
--- a/drivers/dma/virt-dma.c
+++ b/drivers/dma/virt-dma.c
@@ -84,10 +84,10 @@ static void vchan_complete(unsigned long arg)
list_del(&vd->node);
- vc->desc_free(vd);
-
if (cb)
cb(cb_data);
+
+ vc->desc_free(vd);
}
}
--
1.7.9.5
1.7.9.5