Skip to content

Commit

Permalink
wd: fix memory leak
Browse files Browse the repository at this point in the history
Unmap mapped IO in wd_probe1() if register_netdev() failed.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Kulikov Vasiliy authored and David S. Miller committed Jul 15, 2010
1 parent 8aa06af commit bdb0f86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/wd.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,10 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
#endif

err = register_netdev(dev);
if (err)
if (err) {
free_irq(dev->irq, dev);
iounmap(ei_status.mem);
}
return err;
}

Expand Down

0 comments on commit bdb0f86

Please sign in to comment.