diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index fe625213ccef..1b9acfd88e35 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -22925,7 +22926,15 @@ static QDF_STATUS wlan_hdd_del_pmksa_cache(struct hdd_adapter *adapter, if (!vdev) return QDF_STATUS_E_FAILURE; - qdf_copy_macaddr(&pmksa.bssid, &pmk_cache->BSSID); + qdf_mem_zero(&pmksa, sizeof(pmksa)); + if (!pmk_cache->ssid_len) { + qdf_copy_macaddr(&pmksa.bssid, &pmk_cache->BSSID); + } else { + qdf_mem_copy(pmksa.ssid, pmk_cache->ssid, pmk_cache->ssid_len); + qdf_mem_copy(pmksa.cache_id, pmk_cache->cache_id, + WLAN_CACHE_ID_LEN); + pmksa.ssid_len = pmk_cache->ssid_len; + } result = wlan_crypto_set_del_pmksa(vdev, &pmksa, false); hdd_objmgr_put_vdev(vdev);