diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 6059f7c09621..8e0c74c1bbad 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -1282,7 +1282,7 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy, struct hdd_context *hdd_ctx; int ret; - hdd_enter_dev(dev); + hdd_enter(); if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { hdd_err("Command not allowed in FTM mode"); @@ -1346,8 +1346,6 @@ int wlan_hdd_sched_scan_stop(struct net_device *dev) struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); struct hdd_context *hdd_ctx; - hdd_enter_dev(dev); - if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { hdd_err("Command not allowed in FTM mode"); return -EINVAL; @@ -1385,7 +1383,13 @@ static int __wlan_hdd_cfg80211_sched_scan_stop(struct net_device *dev) struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); int errno; - hdd_enter_dev(dev); + hdd_enter(); + + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err_rl("Command not allowed in FTM mode"); + return -EINVAL; + } + /* The return 0 is intentional when Recovery and Load/Unload in * progress. We did observe a crash due to a return of