소스 검색

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);