We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22ebc26 commit 683b972Copy full SHA for 683b972
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
@@ -305,8 +305,12 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
305
brcmf_info("Firmware: %s %s\n", ri->chipname, buf);
306
307
/* locate firmware version number for ethtool */
308
- ptr = strrchr(buf, ' ') + 1;
309
- strscpy(ifp->drvr->fwver, ptr, sizeof(ifp->drvr->fwver));
+ ptr = strrchr(buf, ' ');
+ if (!ptr) {
310
+ bphy_err(drvr, "Retrieving version number failed");
311
+ goto done;
312
+ }
313
+ strscpy(ifp->drvr->fwver, ptr + 1, sizeof(ifp->drvr->fwver));
314
315
/* Query for 'clmver' to get CLM version info from firmware */
316
memset(buf, 0, sizeof(buf));
0 commit comments