Browse Source

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
Ashish Kumar Dhanotiya 4 years ago
parent
commit
55e9e445ad
1 changed files with 4 additions and 0 deletions
  1. 4 0
      core/hdd/src/wlan_hdd_cfg80211.c

+ 4 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -23138,6 +23138,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;