diff options
author | Johannes Berg <johannes.berg@intel.com> | 2016-09-14 09:41:34 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2016-09-14 12:08:33 +0200 |
commit | 0b97a484e52cb423662eb98904aad82dafcc1f10 (patch) | |
tree | 06f820945bca59ef0aa6b8d8779c196c00519c21 /net/mac80211/tx.c | |
parent | ad5987b47e96a0fb6d13fea250e936aed000093c (diff) | |
download | linux-0b97a484e52cb423662eb98904aad82dafcc1f10.tar.gz linux-0b97a484e52cb423662eb98904aad82dafcc1f10.tar.bz2 linux-0b97a484e52cb423662eb98904aad82dafcc1f10.zip |
mac80211: check skb_linearize() return value
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>
Diffstat (limited to 'net/mac80211/tx.c')
-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 cc8e95554b48..18b285e06bc8 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1515,8 +1515,12 @@ out: spin_unlock_bh(&fq->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; } |