mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 19:07:52 +00:00
b43: Fix controller restart crash
This fixes a kernel crash on rmmod, in the case where the controller was restarted before doing the rmmod. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
167ad6f7a2
commit
3bf0a32e22
1 changed files with 10 additions and 2 deletions
|
@ -4271,7 +4271,9 @@ static void b43_chip_reset(struct work_struct *work)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
|
if (err)
|
||||||
|
wl->current_dev = NULL; /* Failed to init the dev. */
|
||||||
mutex_unlock(&wl->mutex);
|
mutex_unlock(&wl->mutex);
|
||||||
if (err)
|
if (err)
|
||||||
b43err(wl, "Controller restart FAILED\n");
|
b43err(wl, "Controller restart FAILED\n");
|
||||||
|
@ -4412,9 +4414,11 @@ static void b43_one_core_detach(struct ssb_device *dev)
|
||||||
struct b43_wldev *wldev;
|
struct b43_wldev *wldev;
|
||||||
struct b43_wl *wl;
|
struct b43_wl *wl;
|
||||||
|
|
||||||
|
/* Do not cancel ieee80211-workqueue based work here.
|
||||||
|
* See comment in b43_remove(). */
|
||||||
|
|
||||||
wldev = ssb_get_drvdata(dev);
|
wldev = ssb_get_drvdata(dev);
|
||||||
wl = wldev->wl;
|
wl = wldev->wl;
|
||||||
cancel_work_sync(&wldev->restart_work);
|
|
||||||
b43_debugfs_remove_device(wldev);
|
b43_debugfs_remove_device(wldev);
|
||||||
b43_wireless_core_detach(wldev);
|
b43_wireless_core_detach(wldev);
|
||||||
list_del(&wldev->list);
|
list_del(&wldev->list);
|
||||||
|
@ -4599,6 +4603,10 @@ static void b43_remove(struct ssb_device *dev)
|
||||||
struct b43_wl *wl = ssb_get_devtypedata(dev);
|
struct b43_wl *wl = ssb_get_devtypedata(dev);
|
||||||
struct b43_wldev *wldev = ssb_get_drvdata(dev);
|
struct b43_wldev *wldev = ssb_get_drvdata(dev);
|
||||||
|
|
||||||
|
/* We must cancel any work here before unregistering from ieee80211,
|
||||||
|
* as the ieee80211 unreg will destroy the workqueue. */
|
||||||
|
cancel_work_sync(&wldev->restart_work);
|
||||||
|
|
||||||
B43_WARN_ON(!wl);
|
B43_WARN_ON(!wl);
|
||||||
if (wl->current_dev == wldev)
|
if (wl->current_dev == wldev)
|
||||||
ieee80211_unregister_hw(wl->hw);
|
ieee80211_unregister_hw(wl->hw);
|
||||||
|
|
Loading…
Reference in a new issue