Skip to content

Commit

Permalink
DM9000: fix use of kfree() on net device
Browse files Browse the repository at this point in the history
The DM9000 network driver is calling kfree() on an netdev
causing the system to oops if the probe fails. The right
thing to do is call free_netdev().

Thanks to Russell King for spotting this.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Ben Dooks authored and Jeff Garzik committed May 8, 2007
1 parent d17ecb2 commit 9fd9f9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/dm9000.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ dm9000_probe(struct platform_device *pdev)
printk("%s: not found (%d).\n", CARDNAME, ret);

dm9000_release_board(pdev, db);
kfree(ndev);
free_netdev(ndev);

return ret;
}
Expand Down Expand Up @@ -1193,7 +1193,7 @@ dm9000_drv_remove(struct platform_device *pdev)

unregister_netdev(ndev);
dm9000_release_board(pdev, (board_info_t *) ndev->priv);
kfree(ndev); /* free device structure */
free_netdev(ndev); /* free device structure */

PRINTK1("clean_module() exit\n");

Expand Down

0 comments on commit 9fd9f9b

Please sign in to comment.