This is a note to let you know that I've just added the patch titled

    b43: Fix unload oops if firmware is not available

to the 3.13-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     b43-fix-unload-oops-if-firmware-is-not-available.patch
and it can be found in the queue-3.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 0673effd41dba323d6a280ef37b5ef29f3f5a653 Mon Sep 17 00:00:00 2001
From: Larry Finger <[email protected]>
Date: Sun, 12 Jan 2014 15:11:38 -0600
Subject: b43: Fix unload oops if firmware is not available

From: Larry Finger <[email protected]>

commit 0673effd41dba323d6a280ef37b5ef29f3f5a653 upstream.

The asyncronous firmware load uses a completion struct to hold firmware
processing until the user-space routines are up and running. There is.
however, a problem in that the waiter is nevered canceled during teardown.
As a result, unloading the driver when firmware is not available causes an oops.

To be able to access the completion structure at teardown, it had to be moved
into the b43_wldev structure.

This patch also fixes a typo in a comment.

Signed-off-by: Larry Finger <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/net/wireless/b43/b43.h  |    4 ++--
 drivers/net/wireless/b43/main.c |   10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -731,8 +731,6 @@ enum b43_firmware_file_type {
 struct b43_request_fw_context {
        /* The device we are requesting the fw for. */
        struct b43_wldev *dev;
-       /* a completion event structure needed if this call is asynchronous */
-       struct completion fw_load_complete;
        /* a pointer to the firmware object */
        const struct firmware *blob;
        /* The type of firmware to request. */
@@ -809,6 +807,8 @@ enum {
 struct b43_wldev {
        struct b43_bus_dev *dev;
        struct b43_wl *wl;
+       /* a completion event structure needed if this call is asynchronous */
+       struct completion fw_load_complete;
 
        /* The device initialization status.
         * Use b43_status() to query. */
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2070,6 +2070,7 @@ void b43_do_release_fw(struct b43_firmwa
 
 static void b43_release_firmware(struct b43_wldev *dev)
 {
+       complete(&dev->fw_load_complete);
        b43_do_release_fw(&dev->fw.ucode);
        b43_do_release_fw(&dev->fw.pcm);
        b43_do_release_fw(&dev->fw.initvals);
@@ -2095,7 +2096,7 @@ static void b43_fw_cb(const struct firmw
        struct b43_request_fw_context *ctx = context;
 
        ctx->blob = firmware;
-       complete(&ctx->fw_load_complete);
+       complete(&ctx->dev->fw_load_complete);
 }
 
 int b43_do_request_fw(struct b43_request_fw_context *ctx,
@@ -2142,7 +2143,7 @@ int b43_do_request_fw(struct b43_request
        }
        if (async) {
                /* do this part asynchronously */
-               init_completion(&ctx->fw_load_complete);
+               init_completion(&ctx->dev->fw_load_complete);
                err = request_firmware_nowait(THIS_MODULE, 1, ctx->fwname,
                                              ctx->dev->dev->dev, GFP_KERNEL,
                                              ctx, b43_fw_cb);
@@ -2150,12 +2151,11 @@ int b43_do_request_fw(struct b43_request
                        pr_err("Unable to load firmware\n");
                        return err;
                }
-               /* stall here until fw ready */
-               wait_for_completion(&ctx->fw_load_complete);
+               wait_for_completion(&ctx->dev->fw_load_complete);
                if (ctx->blob)
                        goto fw_ready;
        /* On some ARM systems, the async request will fail, but the next sync
-        * request works. For this reason, we dall through here
+        * request works. For this reason, we fall through here
         */
        }
        err = request_firmware(&ctx->blob, ctx->fwname,


Patches currently in stable-queue which might be from [email protected] 
are

queue-3.13/b43-fix-lockdep-splat.patch
queue-3.13/staging-r8712u-set-device-type-to-wlan.patch
queue-3.13/rtlwifi-redo-register-save-locations.patch
queue-3.13/rtlwifi-rtl8192cu-add-new-device-id.patch
queue-3.13/rtlwifi-rtl8192c-add-new-definitions-in-the-dm_common-header.patch
queue-3.13/rtlwifi-rtl8192c-update-dynamic-gain-calculations.patch
queue-3.13/b43-fix-the-wrong-assignment-of-status.freq-in-b43_rx.patch
queue-3.13/b43-fix-unload-oops-if-firmware-is-not-available.patch
queue-3.13/rtlwifi-rtl8192cu-add-new-firmware.patch
queue-3.13/b43legacy-fix-unload-oops-if-firmware-is-not-available.patch
queue-3.13/rtlwifi-rtl8192cu-fix-some-code-in-rf-handling.patch
queue-3.13/rtlwifi-set-the-link-state.patch
queue-3.13/rtlwifi-increase-the-rx-queue-length-for-usb-drivers.patch
queue-3.13/rtlwifi-rtl8192c-add-routines-to-save-restore-power-index-registers.patch
queue-3.13/rtlwifi-rtl8192c-prevent-reconnect-attempts-if-not-connected.patch
queue-3.13/rtlwifi-rtl8188ee-fix-typo-in-code.patch
queue-3.13/rtlwifi-rtl8192cu-update-the-power-index-registers.patch
queue-3.13/rtlwifi-add-missing-code-to-pwdb-statics-routine.patch
queue-3.13/rtlwifi-update-beacon-statistics-for-usb-driver.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to