From patchwork Fri Jan 15 11:21:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benoit PAPILLAULT X-Patchwork-Id: 73217 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0FKkLC4022528 for ; Fri, 15 Jan 2010 20:46:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754412Ab0AOUqQ (ORCPT ); Fri, 15 Jan 2010 15:46:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754019Ab0AOUqQ (ORCPT ); Fri, 15 Jan 2010 15:46:16 -0500 Received: from smtp1-g21.free.fr ([212.27.42.1]:46321 "EHLO smtp1-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753891Ab0AOUqP (ORCPT ); Fri, 15 Jan 2010 15:46:15 -0500 Received: from smtp1-g21.free.fr (localhost [127.0.0.1]) by smtp1-g21.free.fr (Postfix) with ESMTP id D9F339400A6; Fri, 15 Jan 2010 21:46:07 +0100 (CET) Received: from benoit-laptop (ns.popipo.fr [88.163.232.53]) by smtp1-g21.free.fr (Postfix) with ESMTP id CA885940091; Fri, 15 Jan 2010 21:46:04 +0100 (CET) Received: by benoit-laptop (Postfix, from userid 1000) id 6BE4F1DE0DC; Fri, 15 Jan 2010 12:22:22 +0100 (CET) From: Benoit Papillault To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Benoit Papillault , stable@kernel.org Subject: [PATCH] mac80211: check that ieee80211_set_power_mgmt only handles STA interfaces. Date: Fri, 15 Jan 2010 12:21:37 +0100 Message-Id: <1263554497-17442-1-git-send-email-benoit.papillault@free.fr> X-Mailer: git-send-email 1.6.3.3 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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;