From 1f380148ad04ac6596ef1172f19237ed95ab2064 Mon Sep 17 00:00:00 2001 From: Manikandan Mohan Date: Thu, 26 Sep 2019 18:03:25 -0700 Subject: [PATCH] qcacld-3.0: Fix possible null pointer dereference Fix a possible null pointer dereference in wlan_hdd_cfg80211_ll_stats_get and _wlan_hdd_cfg80211_get_station if global qdf device context becomes null. Change-Id: I02362ae2c60769a562acc42805bd8c4ccac0e887 CRs-fixed: 2536319 --- core/hdd/src/wlan_hdd_stats.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 4424e7e4a532..cf4faa8d1457 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -1552,6 +1552,9 @@ int wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy, int errno; qdf_device_t qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + if (!qdf_ctx) + return -EINVAL; + errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync); if (errno) return errno; @@ -4688,6 +4691,9 @@ static int _wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, if (errno) return errno; + if (!qdf_ctx) + return -EINVAL; + errno = pld_qmi_send_get(qdf_ctx->dev); if (errno) return errno;