cfg80211: Fix possible memory leak in function cfg80211_bss_update
authorNguyen Dinh Phi <phind.uet@gmail.com>
Mon, 28 Jun 2021 13:23:34 +0000 (21:23 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 23 Jul 2021 08:38:18 +0000 (10:38 +0200)
commitf9a5c358c8d26fed0cc45f2afc64633d4ba21dff
tree4bd9a74ae3fd97b1a37d41255a4c207b32ab5fba
parent0d059964504a1605d84938c0b5b38f6573121c4a
cfg80211: Fix possible memory leak in function cfg80211_bss_update

When we exceed the limit of BSS entries, this function will free the
new entry, however, at this time, it is the last door to access the
inputed ies, so these ies will be unreferenced objects and cause memory
leak.
Therefore we should free its ies before deallocating the new entry, beside
of dropping it from hidden_list.

Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com>
Link: https://lore.kernel.org/r/20210628132334.851095-1-phind.uet@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/scan.c