qcacld-3.0: Fix some kw warnings

In function hdd_process_genie(), pointers like encrypt_type
and mc_encrypt_type should be validated before getting
dereferenced.

Add pointer validation before every dereferencing takes place.

Change-Id: Ib894153ddac3e75fae5e0e7798b705ac5951ea17
CRs-Fixed: 2775378
This commit is contained in:
wadesong 2020-09-14 11:26:16 +08:00 • committed by snandini
commit fae1b8966e

View file

@ -4946,11 +4946,13 @@ static int32_t hdd_process_genie(struct hdd_adapter *adapter,
hdd_translate_rsn_to_csr_auth_type(
dot11_rsn_ie.akm_suite[0]);
/* dot11_rsn_ie.pwise_cipher_suite_count */
*encrypt_type =
if (encrypt_type)
*encrypt_type =
hdd_translate_rsn_to_csr_encryption_type(
dot11_rsn_ie.pwise_cipher_suites[0]);
/* dot11_rsn_ie.gp_cipher_suite_count */
*mc_encrypt_type =
if (mc_encrypt_type)
*mc_encrypt_type =
hdd_translate_rsn_to_csr_encryption_type(
dot11_rsn_ie.gp_cipher_suite);
#ifdef WLAN_FEATURE_11W
@ -4989,11 +4991,13 @@ static int32_t hdd_process_genie(struct hdd_adapter *adapter,
hdd_translate_wpa_to_csr_auth_type(
dot11_wpa_ie.auth_suites[0]);
/* dot11_wpa_ie.unicast_cipher_count */
*encrypt_type =
if (encrypt_type)
*encrypt_type =
hdd_translate_wpa_to_csr_encryption_type(
dot11_wpa_ie.unicast_ciphers[0]);
/* dot11_wpa_ie.unicast_cipher_count */
*mc_encrypt_type =
if (mc_encrypt_type)
*mc_encrypt_type =
hdd_translate_wpa_to_csr_encryption_type(
dot11_wpa_ie.multicast_cipher);
} else {