]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
b43: Fix oops on unload when firmware not found
authorLarry Finger <Larry.Finger@lwfinger.net>
Wed, 24 Oct 2012 13:57:16 +0000 (08:57 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Nov 2012 08:50:41 +0000 (09:50 +0100)
commit f89ff6441df06abc2d95f3ef67525923032d6283 upstream.

When b43 fails to find firmware when loaded, a subsequent unload will
oops due to calling ieee80211_unregister_hw() when the corresponding
register call was never made.

Commit 2d838bb608e2d1f6cb4280e76748cb812dc822e7 fixed the same problem
for b43legacy.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Tested-by: Markus Kanet <dvmailing@gmx.eu>
Cc: Markus Kanet <dvmailing@gmx.eu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/b43/main.c

index e4d6dc2e37d12479ab2bdef3560d8f700e9e0d13..d6ffd434f41386ea4d189b4b285ed33e473a6991 100644 (file)
@@ -5430,6 +5430,8 @@ static void b43_ssb_remove(struct ssb_device *sdev)
        cancel_work_sync(&wldev->restart_work);
 
        B43_WARN_ON(!wl);
+       if (!wldev->fw.ucode.data)
+               return;                 /* NULL if firmware never loaded */
        if (wl->current_dev == wldev) {
                /* Restore the queues count before unregistering, because firmware detect
                 * might have modified it. Restoring is important, so the networking