]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
cfg80211: return -ENOENT when stopping sched_scan while not running
authorLuciano Coelho <coelho@ti.com>
Fri, 8 Jul 2011 08:16:16 +0000 (11:16 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 8 Jul 2011 15:47:54 +0000 (11:47 -0400)
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>
include/linux/nl80211.h
net/wireless/scan.c

index 3ec2f949bf7ac72f527e00e4e8e5cafd4c669da3..8cb025a0009406b9cdc13fd7f55456a9b2dc3e46 100644 (file)
  *     passed, all channels allowed for the current regulatory domain
  *     are used.  Extra IEs can also be passed from the userspace by
  *     using the %NL80211_ATTR_IE attribute.
- * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan
+ * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan.  Returns -ENOENT
+ *     if scheduled scan is not running.
  * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan
  *     results available.
  * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has
index 5d23503dd5e0ca3a4d8a8d3f0af70b1ca855ca10..ce04566a2ecc43cd30effd890ef5fa52a9afe5da 100644 (file)
@@ -137,7 +137,7 @@ int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev,
        ASSERT_RDEV_LOCK(rdev);
 
        if (!rdev->sched_scan_req)
-               return 0;
+               return -ENOENT;
 
        dev = rdev->sched_scan_req->dev;