Patch "brcmfmac: unbind all devices upon failure in firmware callback" has been added to the 4.9-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
brcmfmac: unbind all devices upon failure in firmware callback
to the 4.9-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:
brcmfmac-unbind-all-devices-upon-failure-in-firmware-callback.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
7a51461fc2da82a6c565a3ee65c41c197f28225dMon Sep 17 00:00:00 2001
From: Arend Van Spriel <[email protected]>
Date: Mon, 12 Jun 2017 12:47:34 +0100
Subject: brcmfmac: unbind all devices upon failure in firmware callback
From: Arend Van Spriel <[email protected]>
commit 7a51461fc2da82a6c565a3ee65c41c197f28225d upstream.
When request firmware fails, brcmf_ops_sdio_remove is being called and brcmf_bus freed. In such circumstancies if you do a suspend/resume cycle the kernel hangs on resume due a NULL pointer dereference in resume function. So in brcmf_sdio_firmware_callback() we need to unbind the driver from both sdio_func devices when firmware load failure is indicated.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +3 -2
@@ -3985,14 +3985,14 @@ static void brcmf_sdio_firmware_callbacku8 saveclk;brcmf_dbg (TRACE ,"Enter: dev=%s, err=%d\n" ,dev_name (dev), err); + bus_if =dev_get_drvdata (dev); + sdiodev = bus_if->bus_priv.sdio;if (err) goto fail; - bus_if =dev_get_drvdata (dev);if (!bus_if->drvr)return ; - sdiodev = bus_if->bus_priv.sdio; bus = sdiodev->bus;/* try to download image and nvram to the dongle */
@@ -4081,6 +4081,7 @@ release: fail:brcmf_dbg (TRACE ,"failed: dev=%s, err=%d\n" ,dev_name (dev), err);device_release_driver (dev); +device_release_driver (&sdiodev->func[2 ]->dev); }struct brcmf_sdio *brcmf_sdio_probe (struct brcmf_sdio_dev *sdiodev)
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/brcmfmac-use-firmware-callback-upon-failure-to-load.patch queue-4.9/brcmfmac-add-parameter-to-pass-error-code-in-firmware-callback.patch queue-4.9/brcmfmac-unbind-all-devices-upon-failure-in-firmware-callback.patch