diff options
author | Michael Buesch <mb@bu3sch.de> | 2008-05-22 10:32:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-28 16:43:42 -0400 |
commit | 3bf0a32e22fedc0b46443699db2d61ac2a883ac4 (patch) | |
tree | 5ac0288be689a7fda9a5e6ec2e34bafb72a3f532 | |
parent | 167ad6f7a2b2ae58dfaa46620b9b3212594f38e6 (diff) |
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>
-rw-r--r-- | drivers/net/wireless/b43/main.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index b8e77751065a..6c3d9ea0a9f8 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -4271,7 +4271,9 @@ static void b43_chip_reset(struct work_struct *work) | |||
4271 | goto out; | 4271 | goto out; |
4272 | } | 4272 | } |
4273 | } | 4273 | } |
4274 | out: | 4274 | out: |
4275 | if (err) | ||
4276 | wl->current_dev = NULL; /* Failed to init the dev. */ | ||
4275 | mutex_unlock(&wl->mutex); | 4277 | mutex_unlock(&wl->mutex); |
4276 | if (err) | 4278 | if (err) |
4277 | b43err(wl, "Controller restart FAILED\n"); | 4279 | b43err(wl, "Controller restart FAILED\n"); |
@@ -4412,9 +4414,11 @@ static void b43_one_core_detach(struct ssb_device *dev) | |||
4412 | struct b43_wldev *wldev; | 4414 | struct b43_wldev *wldev; |
4413 | struct b43_wl *wl; | 4415 | struct b43_wl *wl; |
4414 | 4416 | ||
4417 | /* Do not cancel ieee80211-workqueue based work here. | ||
4418 | * See comment in b43_remove(). */ | ||
4419 | |||
4415 | wldev = ssb_get_drvdata(dev); | 4420 | wldev = ssb_get_drvdata(dev); |
4416 | wl = wldev->wl; | 4421 | wl = wldev->wl; |
4417 | cancel_work_sync(&wldev->restart_work); | ||
4418 | b43_debugfs_remove_device(wldev); | 4422 | b43_debugfs_remove_device(wldev); |
4419 | b43_wireless_core_detach(wldev); | 4423 | b43_wireless_core_detach(wldev); |
4420 | list_del(&wldev->list); | 4424 | list_del(&wldev->list); |
@@ -4599,6 +4603,10 @@ static void b43_remove(struct ssb_device *dev) | |||
4599 | struct b43_wl *wl = ssb_get_devtypedata(dev); | 4603 | struct b43_wl *wl = ssb_get_devtypedata(dev); |
4600 | struct b43_wldev *wldev = ssb_get_drvdata(dev); | 4604 | struct b43_wldev *wldev = ssb_get_drvdata(dev); |
4601 | 4605 | ||
4606 | /* We must cancel any work here before unregistering from ieee80211, | ||
4607 | * as the ieee80211 unreg will destroy the workqueue. */ | ||
4608 | cancel_work_sync(&wldev->restart_work); | ||
4609 | |||
4602 | B43_WARN_ON(!wl); | 4610 | B43_WARN_ON(!wl); |
4603 | if (wl->current_dev == wldev) | 4611 | if (wl->current_dev == wldev) |
4604 | ieee80211_unregister_hw(wl->hw); | 4612 | ieee80211_unregister_hw(wl->hw); |