From 83d081a18eeed236e54d8d5698ca1ccbb33e2de7 Mon Sep 17 00:00:00 2001 From: Maciej Sosnowski Date: Fri, 7 Nov 2008 01:45:52 +0000 Subject: [PATCH] --- yaml --- r: 118653 b: refs/heads/master c: c3d4f44f50b65b0b0290e357f8739cfb3f4bcaca h: refs/heads/master i: 118651: f1db4440f7623b71a3d8ce8481e46e55923c3527 v: v3 --- [refs] | 2 +- trunk/drivers/dma/ioat_dma.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index ae4ad3b0b690..55635bff7853 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fd0fcf5c29dd0339c5f5d86eb2cbe9fdad5bcd73 +refs/heads/master: c3d4f44f50b65b0b0290e357f8739cfb3f4bcaca diff --git a/trunk/drivers/dma/ioat_dma.c b/trunk/drivers/dma/ioat_dma.c index b0438c4f0c30..dbb8bbb83a32 100644 --- a/trunk/drivers/dma/ioat_dma.c +++ b/trunk/drivers/dma/ioat_dma.c @@ -807,6 +807,12 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan) struct ioat_desc_sw *desc, *_desc; int in_use_descs = 0; + /* Before freeing channel resources first check + * if they have been previously allocated for this channel. + */ + if (ioat_chan->desccount == 0) + return; + tasklet_disable(&ioat_chan->cleanup_task); ioat_dma_memcpy_cleanup(ioat_chan); @@ -869,6 +875,7 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan) ioat_chan->last_completion = ioat_chan->completion_addr = 0; ioat_chan->pending = 0; ioat_chan->dmacount = 0; + ioat_chan->desccount = 0; ioat_chan->watchdog_completion = 0; ioat_chan->last_compl_desc_addr_hw = 0; ioat_chan->watchdog_tcp_cookie =