diff options
author | Johannes Berg <johannes.berg@intel.com> | 2016-09-14 09:41:34 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-07 15:21:19 +0200 |
commit | 5c091f61e600b5b2b996b5f7fc8c840fee8db809 (patch) | |
tree | dddd288ecc38c567cd01126c8b1ed6e4fa9bd537 /net | |
parent | b0e88ea4a43f44403d4e97fd2054f1b380a8f842 (diff) | |
download | lwn-5c091f61e600b5b2b996b5f7fc8c840fee8db809.tar.gz lwn-5c091f61e600b5b2b996b5f7fc8c840fee8db809.zip |
mac80211: check skb_linearize() return value
commit 0b97a484e52cb423662eb98904aad82dafcc1f10 upstream.
The A-MSDU TX code (within TXQs) didn't always check the return value
of skb_linearize() properly, resulting in potentially passing a frag-
list SKB down to the driver even when it said it can't handle it. Fix
that.
Fixes: 6e0456b545456 ("mac80211: add A-MSDU tx support")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/tx.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 8bad2ad81399..5f0ed8c6584d 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1330,8 +1330,12 @@ out: spin_unlock_bh(&txqi->queue.lock); if (skb && skb_has_frag_list(skb) && - !ieee80211_hw_check(&local->hw, TX_FRAG_LIST)) - skb_linearize(skb); + !ieee80211_hw_check(&local->hw, TX_FRAG_LIST)) { + if (skb_linearize(skb)) { + ieee80211_free_txskb(&local->hw, skb); + return NULL; + } + } return skb; } |