Browse Source

qcacld-3.0: Add pointer crypto_key NULL check before use

Add pointer crypto_key NULL check before use in
__wlan_hdd_cfg80211_set_default_key.

Change-Id: Ia15d2f0ac206c627c493b712fb1616a81e34d878
CRs-Fixed: 2642567
Qun Zhang 5 years ago
parent
commit
d381f6c338
1 changed files with 4 additions and 0 deletions
  1. 4 0
      core/hdd/src/wlan_hdd_cfg80211.c

+ 4 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -16656,6 +16656,10 @@ static int __wlan_hdd_cfg80211_set_default_key(struct wiphy *wiphy,
 	if (0 != ret)
 		return ret;
 	crypto_key = wlan_crypto_get_key(adapter->vdev, key_index);
+	if (!crypto_key) {
+		hdd_err("Invalid NULL key info");
+		return -EINVAL;
+	}
 	hdd_debug("unicast %d, cipher %d", unicast, crypto_key->cipher_type);
 	if (!IS_WEP_CIPHER(crypto_key->cipher_type))
 		return 0;