From 82dd7dea79c7a1a0b19affc0f43e5e54850f02b5 Mon Sep 17 00:00:00 2001 From: Abdul Muqtadeer Ahmed Date: Wed, 5 Aug 2020 11:39:11 +0530 Subject: [PATCH] qcacld-3.0: Add a check for WLM latency manager support Currently there is no check for WLM latency manager support, while setting the latency level which may lead to undefined behavior. To address the above issue add a check for WLM latency manager support. Change-Id: I03aebc1a87a5a40265eea1189503d73f35472644 CRs-Fixed: 2746738 --- core/hdd/src/wlan_hdd_cfg80211.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index a4f69b702fdf..48757de5193a 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -8056,6 +8056,9 @@ static int hdd_config_latency_level(struct hdd_adapter *adapter, uint16_t latency_level; QDF_STATUS status; + if (!hdd_is_wlm_latency_manager_supported(hdd_ctx)) + return -EINVAL; + latency_level = nla_get_u16(attr); switch (latency_level) { case QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_NORMAL: