From patchwork Thu Aug 30 23:04:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10582971 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2EB515A4 for ; Thu, 30 Aug 2018 23:04:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 102592C20E for ; Thu, 30 Aug 2018 23:04:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0159B2C214; Thu, 30 Aug 2018 23:04:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B5342C20E for ; Thu, 30 Aug 2018 23:04:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727067AbeHaDIy (ORCPT ); Thu, 30 Aug 2018 23:08:54 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33467 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725836AbeHaDIx (ORCPT ); Thu, 30 Aug 2018 23:08:53 -0400 Received: by mail-wr1-f67.google.com with SMTP id v90-v6so9505372wrc.0 for ; Thu, 30 Aug 2018 16:04:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LDicyK6ukZUWznvkwuW9CyXnFXeFTskocOH86ssqzUQ=; b=eTIwZgUW3W0+DhUQR86iSgVCNohB8R0ctxj9P3ixy0BOLDDyV09zjPLCJUnzyP6WaC Hz4hFZLzRIHhiUeBMqbMJ2ip1xI+QHLuUxrnBUhXn1V5j4rjg0tEKhUIuxWZi4Lte5OL 8EbkBx1MXYT6IjBJRiokJZzNpQcEXUmOXZXUr//qD1Yn5Robk/1oXmdtirBNkGUmS+2e r+o+GfM8X9FKilzA5DFt3uy6HBxR2N6Bw5zeCrfjdiBFX1gpXatKP/03yyU9vWbecmU+ igteDdLSFr/OxUxkVJvnDw1pLNh/ilDj2tIuRveTDGfkpcNEOZuc7cfOf0ZdREsFHe/I kkow== X-Gm-Message-State: APzg51B/rPG9pj0zZj8xh5S01khGlNjuahjJdL+cCd0l6N3aK2Lm+8UL GwW5oQ+E6jPojzdtqu35E04lVecCDM4= X-Google-Smtp-Source: ANB0VdZqojKauYtKZ13gaNt1lZ4/gG+HMmJQE5reDDKOn/GmzaPl0WVCFwWaqShJ4ykJ4JuSQhRemw== X-Received: by 2002:a5d:55ca:: with SMTP id i10-v6mr8863178wrw.38.1535670262216; Thu, 30 Aug 2018 16:04:22 -0700 (PDT) Received: from localhost.lan ([151.66.53.29]) by smtp.gmail.com with ESMTPSA id l12-v6sm10109221wrv.29.2018.08.30.16.04.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Aug 2018 16:04:21 -0700 (PDT) From: Lorenzo Bianconi To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org Subject: [PATCH] mac80211: fix an off-by-one issue in A-MSDU max_subframe computation Date: Fri, 31 Aug 2018 01:04:13 +0200 Message-Id: <98a581c601ff1974ca4365817596453fd442e1f5.1535670110.git.lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Initialize 'n' to 2 in order to take into account also the first packet in the estimation of max_subframe limit for a given A-MSDU since frag_tail pointer is NULL when ieee80211_amsdu_aggregate routine analyzes the second frame. Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support") Signed-off-by: Lorenzo Bianconi --- net/mac80211/tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 6ca0865de945..9b3b069e418a 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -3174,7 +3174,7 @@ static bool ieee80211_amsdu_aggregate(struct ieee80211_sub_if_data *sdata, void *data; bool ret = false; unsigned int orig_len; - int n = 1, nfrags, pad = 0; + int n = 2, nfrags, pad = 0; u16 hdrlen; if (!ieee80211_hw_check(&local->hw, TX_AMSDU))