From fb42513a123944576a390ca3d6b11f9ffe4c5755 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Tue, 12 Jan 2021 19:31:13 +0530 Subject: [PATCH] qcacld-3.0: Add a check to validate BW for set ap cahn width Currently driver does not validate BW before it invokes the kernel api cfg80211_get_chandef_type. There is a WARN_ON in kernel if above api is invoked with invalid BW. To address above issue add a logic to validate the BW before driver invokes the kernel api. Change-Id: Ie237aa46813bfa4206a1057a0418d9562dbbae75 CRs-Fixed: 2846462 --- core/hdd/src/wlan_hdd_cfg80211.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 3050d1c501ef..c92f38370ebd 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -23245,6 +23245,10 @@ __wlan_hdd_cfg80211_set_ap_channel_width(struct wiphy *wiphy, return -EINVAL; } + if (chandef->width > NL80211_CHAN_WIDTH_40) { + hdd_err_rl("invalid chan width %d", chandef->width); + return -EINVAL; + } if (wlan_hdd_validate_vdev_id(adapter->vdev_id)) return -EINVAL;