qcacld-3.0: Fix memleak in wlan_hdd_cfg80211_do_acs

__wlan_hdd_cfg80211_do_acs mallocs memory of
adapter->session.ap.sap_config.acs_cfg.ch_list
without checking and free original memory.
If hostapd is killed by -9, and interface wlan0 keep on.
wlan_hdd_cfg80211_stop_ap and wlan_hdd_undo_acs isn't called,
acs_cfg.ch_list memory isn't freed.
if hostapd is started again, __wlan_hdd_cfg80211_do_acs is called again,
malloc memory of acs_cfg.ch_list again, last malloced memory is leaked

Change-Id: Ia45615aa75841381b13a2f779cb5d355526d78a2
CRs-Fixed: 2150040
This commit is contained in:
Zhu Jianmin 2017-12-04 19:06:18 +08:00 • committed by snandini
commit 069a61d7a5

View file

@ -2526,6 +2526,8 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
}
sap_config = &adapter->session.ap.sap_config;
if (sap_config->acs_cfg.ch_list)
qdf_mem_free(sap_config->acs_cfg.ch_list);
qdf_mem_zero(&sap_config->acs_cfg, sizeof(struct sap_acs_cfg));
status = hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_ACS_MAX, data, data_len,