From patchwork Sat Dec 18 23:54:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Mosberger-Tang X-Patchwork-Id: 525820 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73C6BC43217 for ; Sat, 18 Dec 2021 23:55:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235410AbhLRXzD (ORCPT ); Sat, 18 Dec 2021 18:55:03 -0500 Received: from o1.ptr2625.egauge.net ([167.89.112.53]:25654 "EHLO o1.ptr2625.egauge.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234953AbhLRXyZ (ORCPT ); Sat, 18 Dec 2021 18:54:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=egauge.net; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type; s=sgd; bh=CGtla6DXX2NW6UxMvorEq0hg5En8baXls+s5VuU2yW4=; b=ZT3DPigF+8Yzg//T+tvalTQV4U/iqz+uDPUDgYectHbd8Wz+Did4jaNjpb1YGt6K8Rqc RgZb/DGQK7zMwVNzzNn1WsyuDe2ETacSJ/C3U/BS6wzMUpn+8ZTpISTYYc28E68DCIFgch 0loZmI1hf2frplbHUGPDkRsLy39w8cYEvX644u8W6bX8SPEThdb11Rdx19WNdvcFNhqwBs znplANeHSIYiKHcS5cEobKbjl8ZVGi2DwV7Hf/Wm3GRLqpXDWCWc0hrgJNuyGz+Cg3N4ya 4/bbiDzuadYC0gAjkbA3smcEuQQ+/cunsH09Xs9z5/lS83iE3AlIN59zjTtZB71A== Received: by filterdrecv-75ff7b5ffb-bdt5z with SMTP id filterdrecv-75ff7b5ffb-bdt5z-1-61BE74A8-34 2021-12-18 23:54:16.964242185 +0000 UTC m=+9336801.486918079 Received: from pearl.egauge.net (unknown) by geopod-ismtpd-3-1 (SG) with ESMTP id wkYIxbwqTFmuQuj_BBAN5w Sat, 18 Dec 2021 23:54:16.793 +0000 (UTC) Received: by pearl.egauge.net (Postfix, from userid 1000) id AFA9870122E; Sat, 18 Dec 2021 16:54:15 -0700 (MST) From: David Mosberger-Tang Subject: [PATCH 14/23] wilc1000: if there is no tx packet, don't increment packets-sent counter Date: Sat, 18 Dec 2021 23:54:17 +0000 (UTC) Message-Id: <20211218235404.3963475-15-davidm@egauge.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211218235404.3963475-1-davidm@egauge.net> References: <20211218235404.3963475-1-davidm@egauge.net> MIME-Version: 1.0 X-SG-EID: +kMxBqj35EdRUKoy8diX1j4AXmPtd302oan+iXZuF8m2Nw4HRW2irNspffT/khET6RJF6+Prbl0h/EtF1rRLvIzRn4xIwWHyaaa0MuWcdn1anLz9y3H4r2KThLcMiVEY0EIxgr1EXfxoyFPRY3oI2uiNhcfBpx5zzTshO9hQbJm3euZxhJnyVVOxbqUUFd+iJm7qgEuwZcGcgA/M3hx59k4Aby5GJp1Sq/DRyrNsOQMJNZ4j7Kqsa7F1rOV7uKAn4il58qhYl/8tLZA4p4eJPg== To: Ajay Singh Cc: Claudiu Beznea , Kalle Valo , "David S. Miller" , Jakub Kicinski , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, David Mosberger-Tang X-Entity-ID: Xg4JGAcGrJFIz2kDG9eoaQ== Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Granted, this case is mostly theoretical as the queue should never be empty in this place, and hence tqe should never be NULL, but it's still wrong to count a packet that doesn't exist. Signed-off-by: David Mosberger-Tang --- drivers/net/wireless/microchip/wilc1000/wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c index 6484e4ab8e159..8e8f0e1de7c4c 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan.c @@ -893,10 +893,10 @@ int wilc_wlan_handle_txq(struct wilc *wilc, u32 *txq_count) u8 mgmt_ptk = 0; tqe = wilc_wlan_txq_remove_from_head(wilc, vmm_entries_ac[i]); - ac_pkt_num_to_chip[vmm_entries_ac[i]]++; if (!tqe) break; + ac_pkt_num_to_chip[vmm_entries_ac[i]]++; vif = tqe->vif; if (vmm_table[i] == 0) break;