瀏覽代碼

qcacmn: Add NULL check for wdev member of vdev's ospriv

Add NULL check for access to wdev.
There could be cases where the wdev could not we initialized
to appropriate values, so we should have a NULL check before
we access its members.

CR's Fixed: 2168374

Change-Id: Id0a3f9b64c5e9beed86f5a3c019a5fe5dbdb8bd7
Vivek Chettri 7 年之前
父節點
當前提交
40789ff92d
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      umac/cmn_services/utils/src/wlan_utility.c

+ 5 - 0
umac/cmn_services/utils/src/wlan_utility.c

@@ -252,6 +252,11 @@ uint8_t *wlan_util_vdev_get_if_name(struct wlan_objmgr_vdev *vdev)
 		return NULL;
 	}
 
+	if (!osif_priv->wdev) {
+		wlan_vdev_obj_unlock(vdev);
+		return NULL;
+	}
+
 	name = osif_priv->wdev->netdev->name;
 	wlan_vdev_obj_unlock(vdev);