Commit b8329882 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] sis900 doesn't free resources

From:  Marcus Alanen <maalanen@ra.abo.fi>

  On error we don't release the previously allocated struct mii_phy:s
parent a884683f
...@@ -531,6 +531,13 @@ static int __init sis900_mii_probe (struct net_device * net_dev) ...@@ -531,6 +531,13 @@ static int __init sis900_mii_probe (struct net_device * net_dev)
if ((mii_phy = kmalloc(sizeof(struct mii_phy), GFP_KERNEL)) == NULL) { if ((mii_phy = kmalloc(sizeof(struct mii_phy), GFP_KERNEL)) == NULL) {
printk(KERN_INFO "Cannot allocate mem for struct mii_phy\n"); printk(KERN_INFO "Cannot allocate mem for struct mii_phy\n");
mii_phy = sis_priv->first_mii;
while (mii_phy) {
struct mii_phy *phy;
phy = mii_phy;
mii_phy = mii_phy->next;
kfree(phy);
}
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