Skip to content

Commit

Permalink
irda: via-ircc proper dma freeing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wang Chen authored and David S. Miller committed Jul 8, 2008
1 parent 3888e9e commit 568b493
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/irda/via-ircc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 568b493

Please sign in to comment.