Skip to content

Commit

Permalink
tokenring/3c359.c: Prevent possible mem leak when open failed
Browse files Browse the repository at this point in the history
Freeing previously allocated buffers in case of error.

Signed-off-by: Jirka Pirko <jirka@pirko.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jirka Pirko authored and David S. Miller committed Nov 24, 2008
1 parent 138a5cd commit 5c94afd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/tokenring/3c359.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,8 @@ static int xl_open(struct net_device *dev)
if (i==0) {
printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers. Adapter disabled \n",dev->name) ;
free_irq(dev->irq,dev) ;
kfree(xl_priv->xl_tx_ring);
kfree(xl_priv->xl_rx_ring);
return -EIO ;
}

Expand Down

0 comments on commit 5c94afd

Please sign in to comment.