From 770edce35134ed924bbbbba71a091c875e8feafb Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Sat, 20 Jun 2020 17:39:07 -0700 Subject: [PATCH] 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 --- components/pmo/core/src/wlan_pmo_suspend_resume.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/pmo/core/src/wlan_pmo_suspend_resume.c b/components/pmo/core/src/wlan_pmo_suspend_resume.c index f0d288f48eb5..bbaabf4410bf 100644 --- a/components/pmo/core/src/wlan_pmo_suspend_resume.c +++ b/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;