Commit 568b4933 authored by Wang Chen's avatar Wang Chen Committed by David S. Miller

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: default avatarWang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: default avatarSamuel Ortiz <samuel@sortiz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3888e9ef
...@@ -1546,6 +1546,7 @@ static int via_ircc_net_open(struct net_device *dev) ...@@ -1546,6 +1546,7 @@ static int via_ircc_net_open(struct net_device *dev)
IRDA_WARNING("%s, unable to allocate dma2=%d\n", IRDA_WARNING("%s, unable to allocate dma2=%d\n",
driver_name, self->io.dma2); driver_name, self->io.dma2);
free_irq(self->io.irq, self); free_irq(self->io.irq, self);
free_dma(self->io.dma);
return -EAGAIN; return -EAGAIN;
} }
} }
...@@ -1606,6 +1607,8 @@ static int via_ircc_net_close(struct net_device *dev) ...@@ -1606,6 +1607,8 @@ static int via_ircc_net_close(struct net_device *dev)
EnAllInt(iobase, OFF); EnAllInt(iobase, OFF);
free_irq(self->io.irq, dev); free_irq(self->io.irq, dev);
free_dma(self->io.dma); free_dma(self->io.dma);
if (self->io.dma2 != self->io.dma)
free_dma(self->io.dma2);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment