brcmfmac: unbind all devices upon failure in firmware callback
authorArend Van Spriel <arend.vanspriel@broadcom.com>
Mon, 12 Jun 2017 11:47:34 +0000 (12:47 +0100)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 23 Jul 2017 03:02:29 +0000 (03:02 +0000)
commitb0600a913c9f8bb7cdee50dbdd7f2d817370afe9
tree145f5f0d5f3a683054347f6f5afbdecf49e2b373
parent532d4f876c4ae631058355d9f5fd9a658669abd1
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