diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index e4e13743197a..7e245482cad2 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -22364,8 +22364,9 @@ static int __wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy, TRACE_CODE_HDD_CFG80211_SET_PMKSA, adapter->vdev_id, result); - sme_set_del_pmkid_cache(hdd_ctx->psoc, adapter->vdev_id, - pmk_cache, true); + if (QDF_IS_STATUS_SUCCESS(result)) + sme_set_del_pmkid_cache(hdd_ctx->psoc, adapter->vdev_id, + pmk_cache, true); qdf_mem_zero(pmk_cache, sizeof(pmk_cache)); @@ -22415,6 +22416,7 @@ static int __wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy, { struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); + QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE; int status = 0; tPmkidCacheInfo *pmk_cache; @@ -22451,23 +22453,24 @@ static int __wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy, hdd_fill_pmksa_info(adapter, pmk_cache, pmksa, true); - /* clear single_pmk_info information */ - sme_clear_sae_single_pmk_info(hdd_ctx->psoc,adapter->vdev_id, - pmk_cache); - /* Delete the PMKID CSR cache */ - if (QDF_STATUS_SUCCESS != - wlan_hdd_del_pmksa_cache(adapter, pmk_cache)) { + qdf_status = wlan_hdd_del_pmksa_cache(adapter, pmk_cache); + if (QDF_IS_STATUS_ERROR(qdf_status)) { if (!pmksa->bssid) hdd_err("Failed to delete PMKSA for null bssid"); else hdd_err("Failed to delete PMKSA for " QDF_MAC_ADDR_FMT, QDF_MAC_ADDR_REF(pmksa->bssid)); status = -EINVAL; - } + } else { + /* clear single_pmk_info information */ + sme_clear_sae_single_pmk_info(hdd_ctx->psoc, adapter->vdev_id, + pmk_cache); - sme_set_del_pmkid_cache(hdd_ctx->psoc, adapter->vdev_id, pmk_cache, - false); + /* Send the delete pmkid command to firmware */ + sme_set_del_pmkid_cache(hdd_ctx->psoc, adapter->vdev_id, + pmk_cache, false); + } qdf_mem_zero(pmk_cache, sizeof(*pmk_cache)); qdf_mem_free(pmk_cache);