From patchwork Tue Sep 27 12:11:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 9351797 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 17A416077A for ; Tue, 27 Sep 2016 12:11:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09A0428F77 for ; Tue, 27 Sep 2016 12:11:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2A0C29065; Tue, 27 Sep 2016 12:11:35 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable 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 D2FA128F77 for ; Tue, 27 Sep 2016 12:11:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933604AbcI0MLT (ORCPT ); Tue, 27 Sep 2016 08:11:19 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:34184 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933305AbcI0MLQ (ORCPT ); Tue, 27 Sep 2016 08:11:16 -0400 Received: by mail-lf0-f65.google.com with SMTP id b71so1689844lfg.1; Tue, 27 Sep 2016 05:11:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HYlnQQml5BK2MhmecJU+0UAL+HIUIwAuqcRD2QkeN6I=; b=hONOW/JqZ2790GimXxVVuglUxulEBIdtsV7NQtafKUW/nt+czJQABLLoyYSI6uPIsy UHG4PBI2rgChaPggOmii9sMqsRmdGwUanhy6N2VQ7W6FZom+gU0WEcM1DsBmV/o7XrBA yh/XIY5Es2du/9vZjNDDp9/ckSsSE2Wk2eEt0JEH+O9BWVguyD/fkzp8SN+UL28/r1K0 xR85o0gJq3VZknI5+4i3cPntBTegN7Vwiy3YVXdz9jjj//GXD9YvPCjZ7J+hSb7kVyNK ywLFTPBeKG2ELvXl3lkoa3803eDrpy0WYbzdgQ22HFTAq6HzvaylT4I9se1QAUDGNj6O A6gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HYlnQQml5BK2MhmecJU+0UAL+HIUIwAuqcRD2QkeN6I=; b=PGkvtqgrkzyDvK6ZbWnXHapEmOsXxJY8qRLMXSSbovdCd0Qj4xFau+dKkzYmJE7SLa 0LPWjFJNPTuiRiIZSQ4dynd7Yi1lu+XI5cpGf3ztxiCREICAL169KscK78vTQoRPAuve 5CjGcP6rePhLvi2M4OwOMfy+XEBjA8XwVXsMrS6J8+eCS0QthsGDaDASZucwJe+TYdub fJ0qJkxj8BabQQ7+GZwjf3oDJC+lqkC7+Bay0QJ/foXIyx2mYNJQzPm46HK52mVm/hA8 rMmd+NBPjh930yBBQ2/LQXqTpWkjCLJq5ytu3Om48Y651fXl119RDr0Ckz9E/W5oDGaL ri3g== X-Gm-Message-State: AA6/9RkOf/0BcmorXkhTGB6PYEUiS/XNHJGWHR1Ii5cYv0HXDrvy77U/dpARnXjHv5h5XQ== X-Received: by 10.25.208.7 with SMTP id h7mr3431719lfg.94.1474978273995; Tue, 27 Sep 2016 05:11:13 -0700 (PDT) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id d15sm380264lfg.0.2016.09.27.05.11.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Sep 2016 05:11:13 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Pieter-Paul Giesberts , Franky Lin , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH V2 4.9] brcmfmac: use correct skb freeing helper when deleting flowring Date: Tue, 27 Sep 2016 14:11:04 +0200 Message-Id: <20160927121104.5771-1-zajec5@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160927091428.19223-1-zajec5@gmail.com> References: <20160927091428.19223-1-zajec5@gmail.com> MIME-Version: 1.0 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 From: Rafał Miłecki Flowrings contain skbs waiting for transmission that were passed to us by netif. It means we checked every one of them looking for 802.1x Ethernet type. When deleting flowring we have to use freeing function that will check for 802.1x type as well. Freeing skbs without a proper check was leading to counter not being properly decreased. This was triggering a WARNING every time brcmf_netdev_wait_pend8021x was called. Signed-off-by: Rafał Miłecki Acked-by: Arend van Spriel Cc: stable@vger.kernel.org # 4.5+ --- V2: Add Cc for stable 4.5+. It doesn't apply cleanly to 4.4 and is not possible for 4.3- due to missing brcmf_get_ifp. --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c index b16b367..d0b738d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c @@ -234,13 +234,20 @@ static void brcmf_flowring_block(struct brcmf_flowring *flow, u16 flowid, void brcmf_flowring_delete(struct brcmf_flowring *flow, u16 flowid) { + struct brcmf_bus *bus_if = dev_get_drvdata(flow->dev); struct brcmf_flowring_ring *ring; + struct brcmf_if *ifp; u16 hash_idx; + u8 ifidx; struct sk_buff *skb; ring = flow->rings[flowid]; if (!ring) return; + + ifidx = brcmf_flowring_ifidx_get(flow, flowid); + ifp = brcmf_get_ifp(bus_if->drvr, ifidx); + brcmf_flowring_block(flow, flowid, false); hash_idx = ring->hash_id; flow->hash[hash_idx].ifidx = BRCMF_FLOWRING_INVALID_IFIDX; @@ -249,7 +256,7 @@ void brcmf_flowring_delete(struct brcmf_flowring *flow, u16 flowid) skb = skb_dequeue(&ring->skblist); while (skb) { - brcmu_pkt_buf_free_skb(skb); + brcmf_txfinalize(ifp, skb, false); skb = skb_dequeue(&ring->skblist); }