qcacld-3.0: Fix null ptr dereference in wma_print_wow_stats

wma_print_wow_stats does not do null validation for pointer vdev
returned from call to function wlan_objmgr_get_vdev_by_id_from_psoc
which can lead to null pointer derefrence.

Add NULL pointer check for vdev in wma_print_wow_stats.

Change-Id: I4fae47b303436bf9f2a4768995cea7640bc6feab
CRs-Fixed: 2564073
This commit is contained in:
Abhinav Kumar 2019-11-12 13:53:21 +05:30 committed by nshrivas
parent 3de9c892dc
commit 9ff4490dcc

View File

@ -1553,6 +1553,12 @@ static void wma_print_wow_stats(t_wma_handle *wma,
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(wma->psoc,
wake_info->vdev_id,
WLAN_LEGACY_WMA_ID);
if (!vdev) {
WMA_LOGE("%s, vdev_id: %d, failed to get vdev from psoc",
__func__, wake_info->vdev_id);
return;
}
ucfg_mc_cp_stats_get_vdev_wake_lock_stats(vdev, &stats);
wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_WMA_ID);
wma_wow_stats_display(&stats);