]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
wifi: brcm80211: fmac: Add error handling for brcmf_usb_dl_writeimage()
authorWentao Liang <vulab@iscas.ac.cn>
Tue, 22 Apr 2025 04:22:02 +0000 (12:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 May 2025 07:43:52 +0000 (09:43 +0200)
commit08424a0922fb9e32a19b09d852ee87fb6c497538
tree718baf901921c39d65a05345a041d2044dddc057
parent8daa71c694b3d1e187e44f8a1acb18a73e2ed324
wifi: brcm80211: fmac: Add error handling for brcmf_usb_dl_writeimage()

commit 8e089e7b585d95122c8122d732d1d5ef8f879396 upstream.

The function brcmf_usb_dl_writeimage() calls the function
brcmf_usb_dl_cmd() but dose not check its return value. The
'state.state' and the 'state.bytes' are uninitialized if the
function brcmf_usb_dl_cmd() fails. It is dangerous to use
uninitialized variables in the conditions.

Add error handling for brcmf_usb_dl_cmd() to jump to error
handling path if the brcmf_usb_dl_cmd() fails and the
'state.state' and the 'state.bytes' are uninitialized.

Improve the error message to report more detailed error
information.

Fixes: 71bb244ba2fd ("brcm80211: fmac: add USB support for bcm43235/6/8 chipsets")
Cc: stable@vger.kernel.org # v3.4+
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Link: https://patch.msgid.link/20250422042203.2259-1-vulab@iscas.ac.cn
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c