[lvc-project] [lvc-patches] [PATCH v2] brcmsmac: add NULL pointer check in wlc_phy_radio_init_2057
Sergey Shtylyov
s.shtylyov at omp.ru
Wed Jul 29 16:35:45 MSK 2026
On 7/29/26 1:13 PM, Dmitriy Okunev wrote:
> Pointer regs_2057_ptr may remain NULL if the device reports unsupported
> phy/radio revisions. This could lead to NULL dereference. Add a check to prevent it.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Dmitriy Okunev <dmitriy.okunev at red-soft.ru>
> ---
> drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c
> index 86cfa3e87a04..54a2a704e86c 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c
> @@ -19760,7 +19760,10 @@ static void wlc_phy_radio_init_2057(struct brcms_phy *pi)
> }
> }
>
> - wlc_phy_init_radio_regs_allbands(pi, regs_2057_ptr);
> + if(regs_2057_ptr)
Пожалуйста, прогоняйте патчи через scripts/checkpatch.pl - по идее, он должен был
указать, что после *if* нужен пробел...
[...]
MBR, Sergey
More information about the lvc-project
mailing list