Skip to content

Commit 1a84ff7

Browse files
Luciano Coelholinvjw
authored andcommitted
cfg80211: return -ENOENT when stopping sched_scan while not running
If we try to stop a scheduled scan while it is not running, we should return -ENOENT instead of simply ignoring the command and returning success. This is more consistent with other parts of the code. Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 331c5ea commit 1a84ff7

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎include/linux/nl80211.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@
247247
* passed, all channels allowed for the current regulatory domain
248248
* are used. Extra IEs can also be passed from the userspace by
249249
* using the %NL80211_ATTR_IE attribute.
250-
* @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan
250+
* @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT
251+
* if scheduled scan is not running.
251252
* @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan
252253
* results available.
253254
* @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has

‎net/wireless/scan.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev,
137137
ASSERT_RDEV_LOCK(rdev);
138138

139139
if (!rdev->sched_scan_req)
140-
return 0;
140+
return -ENOENT;
141141

142142
dev = rdev->sched_scan_req->dev;
143143

0 commit comments

Comments
 (0)