]> err.no Git - linux-2.6/commitdiff
DM9000: fix use of kfree() on net device
authorBen Dooks <ben-linux@fluff.org>
Mon, 7 May 2007 11:13:25 +0000 (11:13 +0000)
committerJeff Garzik <jeff@garzik.org>
Tue, 8 May 2007 05:15:15 +0000 (01:15 -0400)
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>
drivers/net/dm9000.c

index 8cc1174e7f64361847def8e89132ee0ade90f863..0e338539b8224c164cfb81127a335aadc662551a 100644 (file)
@@ -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");