linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: check that ieee80211_set_power_mgmt only handles STA interfaces.
@ 2010-01-15  0:48 Benoit Papillault
  2010-01-15  0:52 ` Luis R. Rodriguez
  2010-01-15 10:17 ` Johannes Berg
  0 siblings, 2 replies; 5+ messages in thread
From: Benoit Papillault @ 2010-01-15  0:48 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Benoit Papillault

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 IBSS) will result in a
oops.

Signed-off-by: Benoit Papillault <benoit.papillault@free.fr>
---
 net/mac80211/cfg.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 8286df5..c9de4e3 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1382,6 +1382,9 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
 	struct ieee80211_conf *conf = &local->hw.conf;
 
+	if (sdata->vif.type != NL80211_IFTYPE_STATION)
+		return 0;
+
 	if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS))
 		return -EOPNOTSUPP;
 
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] mac80211: check that ieee80211_set_power_mgmt only handles STA interfaces.
@ 2010-01-15 11:21 Benoit Papillault
  0 siblings, 0 replies; 5+ messages in thread
From: Benoit Papillault @ 2010-01-15 11:21 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Benoit Papillault, stable

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.

Cc: stable@kernel.org
Signed-off-by: Benoit Papillault <benoit.papillault@free.fr>
---
 net/mac80211/cfg.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 8286df5..2287d31 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1382,6 +1382,9 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
 	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;
 
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-01-15 20:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-15  0:48 [PATCH] mac80211: check that ieee80211_set_power_mgmt only handles STA interfaces Benoit Papillault
2010-01-15  0:52 ` Luis R. Rodriguez
2010-01-15  1:08   ` Benoit PAPILLAULT
2010-01-15 10:17 ` Johannes Berg
  -- strict thread matches above, loose matches on Subject: below --
2010-01-15 11:21 Benoit Papillault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).