]> git.baikalelectronics.ru Git - 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)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 21 Sep 2021 15:08:14 +0000 (18:08 +0300)
commitef92c38c105001e3336ce8260f6e71f8208b48be
tree2b16f1543e37e8c4e787c6825664f653775b7df0
parente55f60ad9c1780ae1d2c5f6564fda18cac8aaa6f
wilc1000: fix possible memory leak in cfg_scan_result()

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: a8c93ab9f479 ("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
drivers/net/wireless/microchip/wilc1000/cfg80211.c