提交 e61b52d1 编写于 作者: P Pavel Roskin 提交者: John W. Linville

b43: fix invalid memory access in b43_ssb_remove()

wldev is freed in b43_one_core_detach() and should not be accessed after
that call.  Keep wldev->dev in a local variable.
Signed-off-by: NPavel Roskin <proski@gnu.org>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 6f89062a
...@@ -5350,6 +5350,7 @@ static void b43_ssb_remove(struct ssb_device *sdev) ...@@ -5350,6 +5350,7 @@ static void b43_ssb_remove(struct ssb_device *sdev)
{ {
struct b43_wl *wl = ssb_get_devtypedata(sdev); struct b43_wl *wl = ssb_get_devtypedata(sdev);
struct b43_wldev *wldev = ssb_get_drvdata(sdev); struct b43_wldev *wldev = ssb_get_drvdata(sdev);
struct b43_bus_dev *dev = wldev->dev;
/* We must cancel any work here before unregistering from ieee80211, /* We must cancel any work here before unregistering from ieee80211,
* as the ieee80211 unreg will destroy the workqueue. */ * as the ieee80211 unreg will destroy the workqueue. */
...@@ -5365,14 +5366,14 @@ static void b43_ssb_remove(struct ssb_device *sdev) ...@@ -5365,14 +5366,14 @@ static void b43_ssb_remove(struct ssb_device *sdev)
ieee80211_unregister_hw(wl->hw); ieee80211_unregister_hw(wl->hw);
} }
b43_one_core_detach(wldev->dev); b43_one_core_detach(dev);
if (list_empty(&wl->devlist)) { if (list_empty(&wl->devlist)) {
b43_leds_unregister(wl); b43_leds_unregister(wl);
/* Last core on the chip unregistered. /* Last core on the chip unregistered.
* We can destroy common struct b43_wl. * We can destroy common struct b43_wl.
*/ */
b43_wireless_exit(wldev->dev, wl); b43_wireless_exit(dev, wl);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册