diff mbox

macsonic, jazzsonic - fix oops on module unload

Message ID alpine.OSX.2.00.0907220119060.796@silk.local
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Finn Thain July 21, 2009, 3:40 p.m. UTC
Set the driver data before using it. Fixes an oops when doing rmmod.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

--
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

Comments

David Miller July 21, 2009, 7:22 p.m. UTC | #1
From: Finn Thain <fthain@telegraphics.com.au>
Date: Wed, 22 Jul 2009 01:40:02 +1000 (EST)

> 
> Set the driver data before using it. Fixes an oops when doing rmmod.
> 
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

Applied, thanks.
--
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

--- a/drivers/net/macsonic.c	2009-07-22 00:47:46.000000000 +1000
+++ b/drivers/net/macsonic.c	2009-07-22 00:49:39.000000000 +1000
@@ -575,6 +575,7 @@ 
  	lp = netdev_priv(dev);
  	lp->device = &pdev->dev;
  	SET_NETDEV_DEV(dev, &pdev->dev);
+	platform_set_drvdata(pdev, dev);

  	/* This will catch fatal stuff like -ENOMEM as well as success */
  	err = mac_onboard_sonic_probe(dev);
--- a/drivers/net/jazzsonic.c	2009-07-22 00:47:52.000000000 +1000
+++ b/drivers/net/jazzsonic.c	2009-07-22 00:52:41.000000000 +1000
@@ -222,6 +222,7 @@ 
  	lp = netdev_priv(dev);
  	lp->device = &pdev->dev;
  	SET_NETDEV_DEV(dev, &pdev->dev);
+	platform_set_drvdata(pdev, dev);

  	netdev_boot_setup_check(dev);