diff mbox

mac80211: Fix tx-mgmt cookie value being left uninitialized.

Message ID 1342456612-11706-1-git-send-email-cavallar@lri.fr (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Nicolas Cavallari July 16, 2012, 4:36 p.m. UTC
commit "mac80211: unify SW/offload remain-on-channel"
moved the cookie assignment from ieee80211_mgmt_tx()
to ieee80211_start_roc_work().  But the latter is only
called where offchannel is needed.  If offchannel isn't
needed/used, a uninitialized cookie value would be returned
to userspace.

This patch sets the cookie value when offchannel isn't used.

Signed-off-by: Nicolas Cavallari <cavallar@lri.fr>
---
based on wireless-testing.

Comments

Johannes Berg July 17, 2012, 9:27 a.m. UTC | #1
On Mon, 2012-07-16 at 18:36 +0200, Nicolas Cavallari wrote:
> commit "mac80211: unify SW/offload remain-on-channel"
> moved the cookie assignment from ieee80211_mgmt_tx()
> to ieee80211_start_roc_work().  But the latter is only
> called where offchannel is needed.  If offchannel isn't
> needed/used, a uninitialized cookie value would be returned
> to userspace.
> 
> This patch sets the cookie value when offchannel isn't used.

Applied, thanks!

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index cfdc03f..106f381 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2493,6 +2493,7 @@  static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
 	skb->dev = sdata->dev;
 
 	if (!need_offchan) {
+		*cookie = (unsigned long) skb;
 		ieee80211_tx_skb(sdata, skb);
 		ret = 0;
 		goto out_unlock;