netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Dooks <ben-linux@fluff.org>
To: netdev@vger.kernel.org, jeff@garzik.org
Subject: [PATCH] DM9000: fix use of kfree() on net device
Date: Mon, 7 May 2007 11:13:25 +0000	[thread overview]
Message-ID: <20070507111325.GA32546@fluff.org.uk> (raw)

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>

diff -urpN -X ../dontdiff linux-2.6.20/drivers/net/dm9000.c linux-2.6.20-dmfix/drivers/net/dm9000.c
--- linux-2.6.20/drivers/net/dm9000.c	2007-02-04 18:44:54.000000000 +0000
+++ linux-2.6.20-dmfix/drivers/net/dm9000.c	2007-02-12 12:01:22.000000000 +0000
@@ -601,7 +601,7 @@ dm9000_probe(struct platform_device *pde
 	printk("%s: not found (%d).\n", CARDNAME, ret);
 
 	dm9000_release_board(pdev, db);
-	kfree(ndev);
+	free_netdev(ndev);
 
 	return ret;
 }
@@ -1194,7 +1194,7 @@ dm9000_drv_remove(struct platform_device
 
 	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");
 
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2007-05-07 11:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-07 11:13 Ben Dooks [this message]
2007-05-08  5:17 ` [PATCH] DM9000: fix use of kfree() on net device Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070507111325.GA32546@fluff.org.uk \
    --to=ben-linux@fluff.org \
    --cc=jeff@garzik.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).