浏览代码

qcacld-3.0: Fix null pointer dereference in cm_roam_switch_to_init()

In cm_roam_switch_to_init(), vdev returned from the api
wlan_objmgr_get_vdev_by_id_from_psoc_debug() could be NULL.
Vdev is dereferenced without NULL check.

Validate vdev against NULL before dereference.

Change-Id: I42ff6943e568f16b78290a3310a8999d26c15af9
CRs-Fixed: 2996914
Pragaspathi Thilagaraj 3 年之前
父节点
当前提交
5c04f676f5
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c

+ 5 - 0
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c

@@ -3199,6 +3199,11 @@ cm_roam_switch_to_init(struct wlan_objmgr_pdev *pdev,
 
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
 						    WLAN_MLME_NB_ID);
+	if (!vdev) {
+		mlme_err("CM_RSO: vdev is null");
+		return QDF_STATUS_E_INVAL;
+	}
+
 	if (cm_is_vdev_disconnecting(vdev) ||
 	    cm_is_vdev_disconnected(vdev)) {
 		mlme_debug("CM_RSO: RSO Init received in disconnected state");