Skip to content

Commit

Permalink
macsonic, jazzsonic: fix oops on module unload
Browse files Browse the repository at this point in the history
Set the driver data before using it. Fixes an oops when doing rmmod.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Finn Thain authored and David S. Miller committed Jul 21, 2009
1 parent 2517747 commit 4564cba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/jazzsonic.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ static int __init jazz_sonic_probe(struct platform_device *pdev)
lp = netdev_priv(dev);
lp->device = &pdev->dev;
SET_NETDEV_DEV(dev, &pdev->dev);
platform_set_drvdata(pdev, dev);

netdev_boot_setup_check(dev);

Expand Down
1 change: 1 addition & 0 deletions drivers/net/macsonic.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ static int __devinit mac_sonic_probe(struct platform_device *pdev)
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);
Expand Down

0 comments on commit 4564cba

Please sign in to comment.