Re: [PATCH] brcm80211: fmac: Add error check for brcmf_usb_dlneeded()

Markus Elfring <[email protected]>
Newsgroups dev.linux.lists.brcm80211,org.kernel.vger.linux-kernel,org.kernel.vger.linux-wireless,org.kernel.vger.stable
Message-ID <[email protected]>
…
> Add error handling for brcmf_usb_dl_cmd() to return the function if the
> 'id.chiprev' is uninitialized.

* Please reconsider the offered conclusion once more.

* I propose to replace the word “for” by “in” (before function names)
  in some summary phrases.


…
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
…
> @@ -798,7 +799,11 @@ brcmf_usb_dlneeded(struct brcmf_usbdev_info *devinfo)
>
>  	/* Check if firmware downloaded already by querying runtime ID */
>  	id.chip = cpu_to_le32(0xDEAD);
> -	brcmf_usb_dl_cmd(devinfo, DL_GETVER, &id, sizeof(id));
> +	err = brcmf_usb_dl_cmd(devinfo, DL_GETVER, &id, sizeof(id));
> +	if (err) {
> +		brcmf_err("DL_GETID Failed\n");
> +		return false;
> +	}
…

Would an error hint like “DL_GETVER failed\n” be more appropriate here?

Regards,
Markus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.