[PATCH] DMAENGINE: too many kref_put calls

From: Shannon Nelson
Date: Sat Oct 27 2007 - 02:32:45 EST


When a channel is removed from dmaengine, too many kref_put() calls
are made and the device removal happens too soon, usually causing
a panic.

Cc: Haavard Skinnemoen <hskinnemoen@xxxxxxxxx>
Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
Signed-off-by: Shannon Nelson <shannon.nelson@xxxxxxxxx>
---

drivers/dma/dmaengine.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 84257f7..245da53 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -134,8 +134,7 @@ static void dma_async_device_cleanup(struct kref *kref);

static void dma_dev_release(struct device *dev)
{
- struct dma_chan *chan = to_dma_chan(dev);
- kref_put(&chan->device->refcount, dma_async_device_cleanup);
+ return;
}

static struct class dma_devclass = {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/