]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
wifi: brcmfmac: avoid NULL-deref in survey dump for 2G only device
authorArend van Spriel <arend.vanspriel@broadcom.com>
Tue, 3 Jan 2023 12:41:16 +0000 (13:41 +0100)
committerKalle Valo <kvalo@kernel.org>
Mon, 16 Jan 2023 11:25:53 +0000 (13:25 +0200)
commitaadb50d1571211c73248605bcc1f4b9f8e3d1364
treed45c4b400f951431ad67516af0981471d16e4f7d
parente5d1ab1a73ad275c0205cbc09a0a9f9f42bbb87f
wifi: brcmfmac: avoid NULL-deref in survey dump for 2G only device

When dealing with a device for 2GHz band only the wiphy->bands for
5GHz will be NULL. This would result in a NULL-deref in the
brcmf_cfg80211_dump_survey() function. Rework the code with a
for-loop to make it easier to add another band.

Fixes: 6c04deae1438 ("brcmfmac: Add dump_survey cfg80211 ops for HostApd AutoChannelSelection")
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230103124117.271988-3-arend.vanspriel@broadcom.com
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c