qcacmn: Check for valid monitor vdev during init

As part of monitor mode init, add check for null monitor vdev before
accessing vdev_id in case prevous cleanup of monitor vdev still ongoing.

Change-Id: I0165684c8aa2abea73fa8c0d1692dac789fb20f6
CRs-Fixed: 2835758
This commit is contained in:
Saket Jha 2020-12-11 11:12:05 -08:00 • committed by Gerrit - the friendly Code Review server
commit 0903e32e40

View file

@ -7061,7 +7061,7 @@ static uint8_t dp_get_mon_vdev_from_pdev_wifi3(struct cdp_soc_t *soc_hdl,
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
struct dp_pdev *pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
if (qdf_unlikely(!pdev))
if (qdf_unlikely(!pdev || !pdev->monitor_vdev))
return -EINVAL;
return pdev->monitor_vdev->vdev_id;