Skip to content

Commit

Permalink
eth16i: fix memory leak
Browse files Browse the repository at this point in the history
Free allocated netdev if no probe is expected.

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 0eff683 commit 04d5821
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/eth16i.c
Original file line number Diff line number Diff line change
Expand Up @@ -1442,8 +1442,10 @@ int __init init_module(void)
dev->if_port = eth16i_parse_mediatype(mediatype[this_dev]);

if(io[this_dev] == 0) {
if(this_dev != 0) /* Only autoprobe 1st one */
if (this_dev != 0) { /* Only autoprobe 1st one */
free_netdev(dev);
break;
}

printk(KERN_NOTICE "eth16i.c: Presently autoprobing (not recommended) for a single card.\n");
}
Expand Down

0 comments on commit 04d5821

Please sign in to comment.