From f502b47633087e43cdd38aecabc8ca402631364d Mon Sep 17 00:00:00 2001 From: Surabhi Vishnoi Date: Fri, 22 Jul 2022 16:17:05 +0530 Subject: [PATCH] qcacld-3.0: Allow monitor mode vendor cmd only if mon iface is created QCA_NL80211_VENDOR_SUBCMD_SET_MONITOR_MODE is used to set the config for packet capture feature on STA interface. Currently this vendor command is allowed even if monitor interface which will be used in packet capture mode is not created, which is wrong. To fix this, allow monitor mode config related to packet capture feature only if monitor interface is created. Change-Id: Iea94b4cd5f21d8ce13643c209d4027972d7a16d3 CRs-Fixed: 3256298 --- core/hdd/src/wlan_hdd_cfg80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 1f182a8fbc12..08b6ed22fc77 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -15714,7 +15714,8 @@ __wlan_hdd_cfg80211_set_monitor_mode(struct wiphy *wiphy, return -EPERM; } - if (!ucfg_pkt_capture_get_mode(hdd_ctx->psoc)) + if (!ucfg_pkt_capture_get_mode(hdd_ctx->psoc) || + !hdd_is_pkt_capture_mon_enable(adapter)) return -EPERM; errno = hdd_validate_adapter(adapter);