netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: dfoley <dfoley@telus.net>
To: netdev@vger.kernel.org
Cc: steve.glendinning@smsc.com
Subject: smsc911x unloading crash
Date: Thu, 18 Dec 2008 14:50:34 -0800	[thread overview]
Message-ID: <494AD3BA.9030602@telus.net> (raw)

I am testing out the new smsc911x driver that is in the linux-next tree.
I get a crash when unloading the module. I've got this patch to fix it. 
I noticed that the dev_set_drvdata is clobbering the data when
the driver's ..._remove function calls dev = platform_get_drvdata(pdev);
I've back ported this to run on 2.6.27, so this patch may or
may not be needed. Sorry if it's a matter of not having the latest version.

diff -purN a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
--- a/drivers/net/smsc911x.c    2008-12-18 10:03:27.000000000 -0800
+++ b/drivers/net/smsc911x.c    2008-12-18 12:03:52.000000000 -0800
@@ -822,7 +822,6 @@ static int __devinit smsc911x_mii_init(s
                 pdata->mii_bus->irq[i] = PHY_POLL;

         pdata->mii_bus->parent = &pdev->dev;
-       dev_set_drvdata(&pdev->dev, &pdata->mii_bus);

         pdata->using_extphy = 0;

@@ -1872,7 +1871,7 @@ static int __devexit smsc911x_drv_remove
         res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
                                            "smsc911x-memory");
         if (!res)
-               platform_get_resource(pdev, IORESOURCE_MEM, 0);
+               res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

         release_mem_region(res->start, res->end - res->start);


             reply	other threads:[~2008-12-18 22:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-18 22:50 dfoley [this message]
2008-12-19  6:55 ` smsc911x unloading crash David Miller
2008-12-19 12:13   ` Steve.Glendinning

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=494AD3BA.9030602@telus.net \
    --to=dfoley@telus.net \
    --cc=netdev@vger.kernel.org \
    --cc=steve.glendinning@smsc.com \
    /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).