Răsfoiți Sursa

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 ani în urmă
părinte
comite
40789ff92d
1 a modificat fișierele cu 5 adăugiri și 0 ștergeri
  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);