brcmfmac: unbind all devices upon failure in firmware callback
commitc81d034bd09aeac70ad0e0a51d281659fff304a8
authorArend Van Spriel <arend.vanspriel@broadcom.com>
Mon, 12 Jun 2017 11:47:34 +0000 (12 12:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Jun 2017 11:00:29 +0000 (29 13:00 +0200)
tree60fa27d4efe8a6f1af303602f253cad48948ad59
parentba2d8d67875c67fdbd676a3990bbf99064826b03
brcmfmac: unbind all devices upon failure in firmware callback

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.

Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c