Explorar el Código

qcacld-3.0: Avoid NULL pointer dereference

Function mlme_get_dynamic_oce_flags can return the NULL value.
Avoid and check for NULL pointer in the callers.

Change-Id: Idc83a9e5dea812a73fed24de3aa2c2c49436f7d1
CRs-Fixed: 2462716
Bala Venkatesh hace 5 años
padre
commit
9ae5e2cd2f

+ 2 - 0
components/mlme/dispatcher/src/wlan_mlme_api.c

@@ -1956,6 +1956,8 @@ static void wlan_mlme_send_oce_flags_fw(struct wlan_objmgr_pdev *pdev,
 
 	if (wlan_vdev_mlme_get_opmode(vdev) == QDF_STA_MODE) {
 		dynamic_fw_value = mlme_get_dynamic_oce_flags(vdev);
+		if (!dynamic_fw_value)
+			return;
 		if (*updated_fw_value == *dynamic_fw_value) {
 			mlme_legacy_debug("Current FW flags matches with updated value.");
 			return;

+ 2 - 2
core/sme/src/csr/csr_api_roam.c

@@ -16821,8 +16821,8 @@ static void csr_store_oce_cfg_flags_in_vdev(struct mac_context *mac,
 		return;
 
 	vdev_dynamic_oce = mlme_get_dynamic_oce_flags(vdev);
-
-	*vdev_dynamic_oce = mac->mlme_cfg->oce.feature_bitmap;
+	if (vdev_dynamic_oce)
+		*vdev_dynamic_oce = mac->mlme_cfg->oce.feature_bitmap;
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
 }