diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-10-08 08:37:47 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-10-22 04:42:09 -0400 |
commit | f409079bb678600be0201cd03afb4731f0480b4e (patch) | |
tree | 4e2d6d4fe2a20aa048067af57b0bd49cf145e25c /net/mac80211/driver-ops.h | |
parent | 723e73acd16d2ea08cdbd8b449b7bc69389b94d4 (diff) |
mac80211: sanity check CW_min/CW_max towards driver
There's no reason to ever set invalid CW_min/CW_max to the
drivers, we should catch it in higher layers. However, the
consequences of setting it wrong can be quite severe, so
double-check at a low level and error out for invalid data.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/driver-ops.h')
-rw-r--r-- | net/mac80211/driver-ops.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index 1bbb0790264f..3df28e0fa045 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h | |||
@@ -631,6 +631,12 @@ static inline int drv_conf_tx(struct ieee80211_local *local, | |||
631 | if (!check_sdata_in_driver(sdata)) | 631 | if (!check_sdata_in_driver(sdata)) |
632 | return -EIO; | 632 | return -EIO; |
633 | 633 | ||
634 | if (WARN_ONCE(params->cw_min == 0 || | ||
635 | params->cw_min > params->cw_max, | ||
636 | "%s: invalid CW_min/CW_max: %d/%d\n", | ||
637 | sdata->name, params->cw_min, params->cw_max)) | ||
638 | return -EINVAL; | ||
639 | |||
634 | trace_drv_conf_tx(local, sdata, ac, params); | 640 | trace_drv_conf_tx(local, sdata, ac, params); |
635 | if (local->ops->conf_tx) | 641 | if (local->ops->conf_tx) |
636 | ret = local->ops->conf_tx(&local->hw, &sdata->vif, | 642 | ret = local->ops->conf_tx(&local->hw, &sdata->vif, |