Skip to content

Commit 3f4a094

Browse files
dmantipovKalle Valo
authored andcommitted
wifi: brcmsmac: add gain range check to wlc_phy_iqcal_gainparams_nphy()
In 'wlc_phy_iqcal_gainparams_nphy()', add gain range check to WARN() instead of possible out-of-bounds 'tbl_iqcal_gainparams_nphy' access. Compile tested only. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov <[email protected]> Acked-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 73e456b commit 3f4a094

File tree

1 file changed

+3
-0
lines changed
  • drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy

1 file changed

+3
-0
lines changed

drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23423,6 +23423,9 @@ wlc_phy_iqcal_gainparams_nphy(struct brcms_phy *pi, u16 core_no,
2342323423
break;
2342423424
}
2342523425

23426+
if (WARN_ON(k == NPHY_IQCAL_NUMGAINS))
23427+
return;
23428+
2342623429
params->txgm = tbl_iqcal_gainparams_nphy[band_idx][k][1];
2342723430
params->pga = tbl_iqcal_gainparams_nphy[band_idx][k][2];
2342823431
params->pad = tbl_iqcal_gainparams_nphy[band_idx][k][3];

0 commit comments

Comments
 (0)