Parcourir la source

qcacld-3.0: Add NULL check for nan private objects

In ndi_remove_and_update_primary_connection() of NAN component,
add missing NULL checks for psoc and vdev NAN private objects
to avoid possible NULL dereference.

Change-Id: Iff3e248259ab67628d081d30f16d1822a0ea6dcb
CRs-Fixed: 2423991
Rajeev Kumar Sirasanagandla il y a 5 ans
Parent
commit
fa4e43888b
1 fichiers modifiés avec 9 ajouts et 0 suppressions
  1. 9 0
      components/nan/core/src/nan_main.c

+ 9 - 0
components/nan/core/src/nan_main.c

@@ -403,7 +403,16 @@ ndi_remove_and_update_primary_connection(struct wlan_objmgr_psoc *psoc,
 	qdf_list_t *peer_list;
 
 	psoc_nan_obj = nan_get_psoc_priv_obj(psoc);
+	if (!psoc_nan_obj) {
+		nan_err("Invalid psoc nan private obj");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
 	vdev_nan_obj = nan_get_vdev_priv_obj(vdev);
+	if (!vdev_nan_obj) {
+		nan_err("Invalid vdev nan private obj");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
 
 	peer_list = &vdev->vdev_objmgr.wlan_peer_list;
 	if (!peer_list) {