diff options
author | Johannes Berg <johannes.berg@intel.com> | 2021-04-16 10:42:14 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-14 10:50:00 +0300 |
commit | 9e7fcf39e2f80c6680fabb99a83b4b9e2aa229a7 (patch) | |
tree | b4d2045e4588c1ec66e80493cc9e27e11cf009f5 /net | |
parent | c9996845ff6754cf47e8672af00cb99f8567ba74 (diff) | |
download | linux-9e7fcf39e2f80c6680fabb99a83b4b9e2aa229a7.tar.xz |
cfg80211: scan: drop entry from hidden_list on overflow
commit 010bfbe768f7ecc876ffba92db30432de4997e2a upstream.
If we overflow the maximum number of BSS entries and free the
new entry, drop it from any hidden_list that it may have been
added to in the code above or in cfg80211_combine_bsses().
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210416094212.5de7d1676ad7.Ied283b0bc5f504845e7d6ab90626bdfa68bb3dc0@changeid
Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/wireless/scan.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 345ef1c96768..87fc56bc4f1e 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -1753,6 +1753,8 @@ cfg80211_bss_update(struct cfg80211_registered_device *rdev, if (rdev->bss_entries >= bss_entries_limit && !cfg80211_bss_expire_oldest(rdev)) { + if (!list_empty(&new->hidden_list)) + list_del(&new->hidden_list); kfree(new); goto drop; } |