diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-02-17 10:48:17 +0100 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-02-20 16:09:54 +0100 |
commit | 37e3308cb2b6933019d9d9c2045877d6d68d9c5a (patch) | |
tree | d9b71804d022a78a65f55d1b6dce4012cd4ee97b /net/mac80211 | |
parent | d9b8396a52b4e857263eeb9e1eba474ea11c19bf (diff) | |
download | op-kernel-dev-37e3308cb2b6933019d9d9c2045877d6d68d9c5a.zip op-kernel-dev-37e3308cb2b6933019d9d9c2045877d6d68d9c5a.tar.gz |
mac80211: allow driver to return error from sched_scan_stop
In order to solve races with sched_scan_stop, it is necessary
for the driver to be able to return an error to propagate that
to cfg80211 so it doesn't send an event.
Reviewed-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/driver-ops.h | 12 | ||||
-rw-r--r-- | net/mac80211/scan.c | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index ef8b385..fc689f5 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -354,16 +354,20 @@ drv_sched_scan_start(struct ieee80211_local *local, return ret; } -static inline void drv_sched_scan_stop(struct ieee80211_local *local, - struct ieee80211_sub_if_data *sdata) +static inline int drv_sched_scan_stop(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata) { + int ret; + might_sleep(); check_sdata_in_driver(sdata); trace_drv_sched_scan_stop(local, sdata); - local->ops->sched_scan_stop(&local->hw, &sdata->vif); - trace_drv_return_void(local); + ret = local->ops->sched_scan_stop(&local->hw, &sdata->vif); + trace_drv_return_int(local, ret); + + return ret; } static inline void drv_sw_scan_start(struct ieee80211_local *local) diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index b211e41..836f500 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -1056,7 +1056,7 @@ int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata) local->sched_scan_req = NULL; if (rcu_access_pointer(local->sched_scan_sdata)) - drv_sched_scan_stop(local, sdata); + ret = drv_sched_scan_stop(local, sdata); out: mutex_unlock(&local->mtx); |