diff mbox

[5/5] netdev: bfin_mac: fix crash when unloading module

Message ID 1243404615-25879-6-git-send-email-vapier@gentoo.org
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

Mike Frysinger May 27, 2009, 6:10 a.m. UTC
From: Graf Yang <graf.yang@analog.com>

If we build the Blackfin EMAC driver as a module and then unload it at
runtime, it would cause a crash:
root:/> rmmod bfin_mac
Hardware Trace:
   0 Target : <0x00004624> { _dump_bfin_trace_buffer + 0x0 }
     Source : <0x000a57b2> { _mdiobus_unregister + 0x42 } CALL pcrel
   1 Target : <0x000a57b2> { _mdiobus_unregister + 0x42 }
     Source : <0x000a577c> { _mdiobus_unregister + 0xc } IF !CC JUMP
   2 Target : <0x000a5770> { _mdiobus_unregister + 0x0 }
     Source : <0x037a4c9e> { :bfin_mac:_cleanup_module + 0x4a } CALL (P2)
   3 Target : <0x037a4c80> { :bfin_mac:_cleanup_module + 0x2c }
     Source : <0x000a0a2e> { _platform_drv_remove + 0xe } JUMP (P1)
   4 Target : <0x000a0a20> { _platform_drv_remove + 0x0 }
     Source : <0x0009fcc0> { ___device_release_driver + 0x50 } CALL (P2)
   ....

URL: http://blackfin.uclinux.org/gf/tracker/4885
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/net/bfin_mac.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Comments

David Miller May 29, 2009, 9:10 a.m. UTC | #1
From: Mike Frysinger <vapier@gentoo.org>
Date: Wed, 27 May 2009 02:10:15 -0400

> If we build the Blackfin EMAC driver as a module and then unload it at
> runtime, it would cause a crash:
> root:/> rmmod bfin_mac

Actually, I reverted patch #4.

This bug is caused by patch #4, integrate this bug fix into
patch #4 and resubmit as one whole change.

Otherwise the tree is not properly bisectable.

Thank you.
--
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
Mike Frysinger May 29, 2009, 11:47 a.m. UTC | #2
On Fri, May 29, 2009 at 05:10, David Miller wrote:
> From: Mike Frysinger <vapier@gentoo.org>
>> If we build the Blackfin EMAC driver as a module and then unload it at
>> runtime, it would cause a crash:
>> root:/> rmmod bfin_mac
>
> Actually, I reverted patch #4.
>
> This bug is caused by patch #4, integrate this bug fix into
> patch #4 and resubmit as one whole change.

will do, thanks
-mike
--
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
diff mbox

Patch

diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index 7f8ea0f..e764f8c 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -1074,8 +1074,7 @@  static int __devexit bfin_mac_remove(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, NULL);
 
-	mdiobus_unregister(lp->mii_bus);
-	mdiobus_free(lp->mii_bus);
+	lp->mii_bus->priv = NULL;
 
 	unregister_netdev(ndev);