提交 5c94afd7 编写于 作者: J Jirka Pirko 提交者: David S. Miller

tokenring/3c359.c: Prevent possible mem leak when open failed

Freeing previously allocated buffers in case of error.
Signed-off-by: NJirka Pirko <jirka@pirko.cz>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 138a5cdf
......@@ -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 ;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册