Переглянути джерело

qcacld-3.0: Validate vdev before try to get vdev ref

Validate vdev and make sure its not null before try to get vdev ref
during runtime pm suspend/resume path.

Change-Id: Ieb9cb26703727edbc302447453000e1d33717343
CRs-Fixed: 2715161
Rajeev Kumar 4 роки тому
батько
коміт
770edce351
1 змінених файлів з 4 додано та 0 видалено
  1. 4 0
      components/pmo/core/src/wlan_pmo_suspend_resume.c

+ 4 - 0
components/pmo/core/src/wlan_pmo_suspend_resume.c

@@ -438,6 +438,8 @@ static void pmo_core_enable_runtime_pm_offloads(struct wlan_objmgr_psoc *psoc)
 	/* Iterate through VDEV list */
 	for (vdev_id = 0; vdev_id < WLAN_UMAC_PSOC_MAX_VDEVS; vdev_id++) {
 		vdev = pmo_psoc_get_vdev(psoc, vdev_id);
+		if (!vdev)
+			continue;
 		status = pmo_vdev_get_ref(vdev);
 		if (QDF_IS_STATUS_ERROR(status))
 			continue;
@@ -456,6 +458,8 @@ static void pmo_core_disable_runtime_pm_offloads(struct wlan_objmgr_psoc *psoc)
 	/* Iterate through VDEV list */
 	for (vdev_id = 0; vdev_id < WLAN_UMAC_PSOC_MAX_VDEVS; vdev_id++) {
 		vdev = pmo_psoc_get_vdev(psoc, vdev_id);
+		if (!vdev)
+			continue;
 		status = pmo_vdev_get_ref(vdev);
 		if (QDF_IS_STATUS_ERROR(status))
 			continue;