* [PATCH] cfg80211: Fix memory leak in cfg80211_inform_single_bss_data
@ 2019-10-27 18:04 Navid Emamdoost
0 siblings, 0 replies; only message in thread
From: Navid Emamdoost @ 2019-10-27 18:04 UTC (permalink / raw)
Cc: emamd001, kjlu, smccaman, Navid Emamdoost, Johannes Berg,
David S. Miller, linux-wireless, netdev, linux-kernel
In the implementation of cfg80211_inform_single_bss_data() the allocated
memory for ies is leaked in case of an error. Release ies if
cfg80211_bss_update() fails.
Fixes: 06aa7afaaa21 ("cfg80211: add cfg80211_inform_bss")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
net/wireless/scan.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index aef240fdf8df..686eb227bcc3 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -1437,8 +1437,10 @@ cfg80211_inform_single_bss_data(struct wiphy *wiphy,
signal_valid = abs(data->chan->center_freq - channel->center_freq) <=
wiphy->max_adj_channel_rssi_comp;
res = cfg80211_bss_update(wiphy_to_rdev(wiphy), &tmp, signal_valid, ts);
- if (!res)
+ if (!res) {
+ kfree(ies);
return NULL;
+ }
if (channel->band == NL80211_BAND_60GHZ) {
bss_type = res->pub.capability & WLAN_CAPABILITY_DMG_TYPE_MASK;
--
2.17.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-10-27 18:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-27 18:04 [PATCH] cfg80211: Fix memory leak in cfg80211_inform_single_bss_data Navid Emamdoost
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.