| Date | Tue, 26 Jan 2010 15:34:50 -0800 | From | Greg KH <> | Subject | [84/98] mac80211: check that ieee80211_set_power_mgmt only handles STA interfaces. |
| |
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Benoit Papillault <benoit.papillault@free.fr>
commit e5de30c9bf4a39db9f54c4a373470ce65881ade0 upstream.
ieee80211_set_power_mgmt is meant for STA interfaces only. Moreover, since sdata->u.mgd.mtx is only initialized for STA interfaces, using this code for any other type of interface (like creating a monitor interface) will result in a oops.
Signed-off-by: Benoit Papillault <benoit.papillault@free.fr> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- net/mac80211/cfg.c | 3 +++ 1 file changed, 3 insertions(+)
--- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1306,6 +1306,9 @@ static int ieee80211_set_power_mgmt(stru struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); struct ieee80211_conf *conf = &local->hw.conf; + if (sdata->vif.type != NL80211_IFTYPE_STATION) + return -EOPNOTSUPP; + if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS)) return -EOPNOTSUPP;
|