[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <282afdd9-bb71-40f8-bfa9-bc7e57e1957d@broadcom.com>
Date: Mon, 14 Apr 2025 11:44:12 +0200
From: Arend van Spriel <arend.vanspriel@...adcom.com>
To: Wentao Liang <vulab@...as.ac.cn>, kvalo@...nel.org
Cc: jacobe.zang@...ion.com, sebastian.reichel@...labora.com,
christophe.jaillet@...adoo.fr, erick.archer@...look.com,
linux-wireless@...r.kernel.org, brcm80211@...ts.linux.dev,
brcm80211-dev-list.pdl@...adcom.com, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH RESEND] brcm80211: fmac: Add error handling for
brcmf_usb_dl_writeimage()
On 4/14/2025 9:20 AM, Wentao Liang wrote:
> 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.
Agree. Have one request though...
Just below the code you touched the USB bootloader state is checked:
/* 2) Check we are in the Waiting state */
if (rdlstate != DL_WAITING) {
- brcmf_err("Failed to DL_START\n");
+ brcmf_err("Invalid DL state: %u\n", rdlstate);
err = -EINVAL;
goto fail;
}
Can you improve the error message as suggested.
Regards,
Arend
> Fixes: 71bb244ba2fd ("brcm80211: fmac: add USB support for bcm43235/6/8 chipsets")
> Cc: stable@...r.kernel.org # v3.4+
> Signed-off-by: Wentao Liang <vulab@...as.ac.cn>
> ---
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Powered by blists - more mailing lists