From 8731e8124ae2a875712b73a08e2e1ee0b31b5efa Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Tue, 11 Jul 2017 18:42:39 +0530 Subject: [PATCH] qcacld-3.0: reset reference count of bss if memory alloc fail In case of reassoc event handler, it may be possible that driver doesn't inform kernel about the new bss as well as doesn't reset the reference count of this bss due to memory allocation failure. Add changes to reset bss reference count if memory allocation failed. Change-Id: I6844d9387dd018e24a4d15bd567294e08ae43941 CRs-Fixed: 2075074 --- core/hdd/src/wlan_hdd_assoc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index c76fd7f040e3..ae8dc5bc6e29 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -2113,8 +2113,11 @@ static void hdd_send_re_assoc_event(struct net_device *dev, QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_DEBUG, buf_ssid_ie, ssid_ie_len); final_req_ie = qdf_mem_malloc(IW_GENERIC_IE_MAX); - if (final_req_ie == NULL) + if (final_req_ie == NULL) { + if (bss) + cfg80211_put_bss(pAdapter->wdev.wiphy, bss); goto done; + } buf_ptr = final_req_ie; qdf_mem_copy(buf_ptr, buf_ssid_ie, ssid_ie_len); buf_ptr += ssid_ie_len;