]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
wilc1000: fix possible memory leak in cfg_scan_result()
authorAjay Singh <ajay.kathat@microchip.com>
Thu, 16 Sep 2021 16:49:18 +0000 (16:49 +0000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Thu, 13 Jan 2022 17:42:17 +0000 (18:42 +0100)
commitf3423075229904864ea21204d0f0ae6e96ca8f88
tree85aaae37a5d6fa224431f223f08ba76f965090f4
parent0f5a589462966ff22e115f5f737167adc7b5150e
wilc1000: fix possible memory leak in cfg_scan_result()

BugLink: https://bugs.launchpad.net/bugs/1953387
[ Upstream commit 3c719fed0f3a5e95b1d164609ecc81c4191ade70 ]

When the BSS reference holds a valid reference, it is not freed. The 'if'
condition is wrong. Instead of the 'if (bss)' check, the 'if (!bss)' check
is used.
The issue is solved by removing the unnecessary 'if' check because
cfg80211_put_bss() already performs the NULL validation.

Fixes: 6cd4fa5ab691 ("staging: wilc1000: make use of cfg80211_inform_bss_frame()")
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210916164902.74629-3-ajay.kathat@microchip.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c