linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Benoit Papillault <benoit.papillault@free.fr>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211: check that ieee80211_set_power_mgmt only handles STA interfaces.
Date: Fri, 15 Jan 2010 11:17:48 +0100	[thread overview]
Message-ID: <1263550668.18341.0.camel@johannes.local> (raw)
In-Reply-To: <1263516497-17332-1-git-send-email-benoit.papillault@free.fr>

[-- Attachment #1: Type: text/plain, Size: 898 bytes --]

On Fri, 2010-01-15 at 01:48 +0100, Benoit Papillault wrote:
> 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.

Odd that nobody else ever saw a problem, is everybody running cards that
don't do power management?

> 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;

You want -EOPNOTSUPP here, and cc stable.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  parent reply	other threads:[~2010-01-15 10:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-01-15 11:21 Benoit Papillault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1263550668.18341.0.camel@johannes.local \
    --to=johannes@sipsolutions.net \
    --cc=benoit.papillault@free.fr \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).