From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from s3.sipsolutions.net ([5.9.151.49]:43504 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750975AbcINKIQ (ORCPT ); Wed, 14 Sep 2016 06:08:16 -0400 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Felix Fietkau , Johannes Berg Subject: [PATCH v2] mac80211: check skb_linearize() return value Date: Wed, 14 Sep 2016 12:08:11 +0200 Message-Id: <1473847691-28039-1-git-send-email-johannes@sipsolutions.net> (sfid-20160914_120819_977232_054FC2C3) Sender: linux-wireless-owner@vger.kernel.org List-ID: From: Johannes Berg 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 --- net/mac80211/tx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index cc8e95554b48..994bc325ca57 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(skb); + return NULL; + } + } return skb; } -- 2.8.1