From 33628529fff116d40d1f69b8d084b730e9e1372b Mon Sep 17 00:00:00 2001 From: Alan Chen Date: Thu, 13 Feb 2020 11:09:23 -0800 Subject: [PATCH] qcacld-3.0: Add null check for logging PMKSA BSSID When wlan_hdd_del_mksa_cache is not successful, it prints a failure message with the PMKSA BSSID without checking whether it is null, causing it to access a null pointer. Add a null check for PMKSA BSSID using it in the log. Change-Id: I7c2f67fe709c61d5371635950021cb8687175245 CRs-Fixed: 2621607 --- core/hdd/src/wlan_hdd_cfg80211.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 2ec0364bd61e..de6110479e4b 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -21417,8 +21417,11 @@ static int __wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy, /* Delete the PMKID CSR cache */ if (QDF_STATUS_SUCCESS != wlan_hdd_del_pmksa_cache(adapter, pmk_cache)) { - hdd_err("Failed to delete PMKSA for " QDF_MAC_ADDR_STR, - QDF_MAC_ADDR_ARRAY(pmksa->bssid)); + if (!pmksa->bssid) + hdd_err("Failed to delete PMKSA for null bssid"); + else + hdd_err("Failed to delete PMKSA for " QDF_MAC_ADDR_STR, + QDF_MAC_ADDR_ARRAY(pmksa->bssid)); status = -EINVAL; }