提交 9fd9f9b6 编写于 作者: B Ben Dooks 提交者: Jeff Garzik

DM9000: fix use of kfree() on net device

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: NBen Dooks <ben-linux@fluff.org>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 d17ecb23
......@@ -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;
}
......@@ -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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册