summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-07-08 03:06:46 -0700
committerDavid S. Miller <davem@davemloft.net>2008-07-08 03:06:46 -0700
commit568b4933a9902aed0f51e2e1bea3da157fb18833 (patch)
treee50e94dd9a9b25af5141bd85d30275362af4524a /drivers/net
parent3888e9efc9bf05e60504d2a420be7a527ff43678 (diff)
irda: via-ircc proper dma freeing
1. dma should be freed when dma2 request fail. 2. dma2 should be freed too when device close. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: Samuel Ortiz <samuel@sortiz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/irda/via-ircc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
index 58e128784585..04ad3573b159 100644
--- a/drivers/net/irda/via-ircc.c
+++ b/drivers/net/irda/via-ircc.c
@@ -1546,6 +1546,7 @@ static int via_ircc_net_open(struct net_device *dev)
IRDA_WARNING("%s, unable to allocate dma2=%d\n",
driver_name, self->io.dma2);
free_irq(self->io.irq, self);
+ free_dma(self->io.dma);
return -EAGAIN;
}
}
@@ -1606,6 +1607,8 @@ static int via_ircc_net_close(struct net_device *dev)
EnAllInt(iobase, OFF);
free_irq(self->io.irq, dev);
free_dma(self->io.dma);
+ if (self->io.dma2 != self->io.dma)
+ free_dma(self->io.dma2);
return 0;
}