Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp807773imm; Fri, 5 Oct 2018 12:07:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV63m1XmrBmrm/vPUCnbEili+sbsLgLksqikHNSRAyu/SKSvaKDFDUGywqCUydnnIH3/4uBuA X-Received: by 2002:a17:902:ba95:: with SMTP id k21-v6mr12945184pls.38.1538766477250; Fri, 05 Oct 2018 12:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538766477; cv=none; d=google.com; s=arc-20160816; b=d6KjkTBGOoZaFWkQQBKu6cFsgr1ivMZT8iTeIj2hJU4qZ/7OoxzFKY/p4HA67RNQLO k0Lp7kvKBWPK04Mx9YuDsOLVZFHBGczX5dKrVG1w3jVFEoKItv2bPbUfJ4YJvGDe4+em Jx5XYyN5sG21EEwoMsT6Y9IVEKKcdqCroLycNv2H/CFHknGHi9W//aCxOUAp8o+TbzBx JugPr8+tcjSTRvug5psqK7PnHUfKVP9a1hKgHidrOL0/kX+J0KVjRTDsPoeFzftMQ+sC b7TFH7R1JVsJiMO6ymj/mYajmG9+hrsBSrpQVrNtUJLeZuDrppQ+6yqZN598rgdLUjJT Hbsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date; bh=qqyHYP61JEM027uAjkQ9U24I7crzaDKdHgO/i9UVKrE=; b=VTX8RE/FM9X5PnobivvRLF7K6ZzrjFlwhlJ+NQK+vUOfzEeRaNCkWmoKSB9arZxrHg hpC+7AxybJ1NV00Aa7T+x3wKfrafk+PTkurMk8wt5g0+1hkOQAIE3yGNyIWvfdw/j/Y6 sGgn9WyZCAWx2LGNRqs00EhHcYTE2No6PzQdThGdWGOzy8GMMk1w/OmGbIbUOCM24mV/ 8Yy5cj3y/MPxNOfzYlAsZvTV2SmrydOnPDda+Yn2njsOUoOMBrK8ZVncngozRubB0+8i xVeurVSep3/IvpI82MQ6+7FF8CYLv+zen4b26aEwKuFOYoIfQuOzY/i2B4rhFWOv+KQ/ SkvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6-v6si7285675pgg.265.2018.10.05.12.07.41; Fri, 05 Oct 2018 12:07:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729207AbeJFCHZ (ORCPT + 99 others); Fri, 5 Oct 2018 22:07:25 -0400 Received: from gateway36.websitewelcome.com ([192.185.199.121]:27525 "EHLO gateway36.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728042AbeJFCHZ (ORCPT ); Fri, 5 Oct 2018 22:07:25 -0400 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 9D416400DEE3C for ; Fri, 5 Oct 2018 12:49:09 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id 8V3og7j7vaSey8V3ogUdmV; Fri, 05 Oct 2018 13:42:48 -0500 X-Authority-Reason: nr=8 Received: from 174.206.93.92.rev.sfr.net ([92.93.206.174]:41754 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.91) (envelope-from ) id 1g8V3n-004OSx-FH; Fri, 05 Oct 2018 13:42:47 -0500 Date: Fri, 5 Oct 2018 20:42:45 +0200 From: "Gustavo A. R. Silva" To: Kalle Valo , "David S. Miller" Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] ath10k: htt_rx: Fix signedness bug in ath10k_update_per_peer_tx_stats Message-ID: <20181005184245.GA11700@embeddedor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 92.93.206.174 X-Source-L: No X-Exim-ID: 1g8V3n-004OSx-FH X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174.206.93.92.rev.sfr.net (embeddedor) [92.93.206.174]:41754 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 6 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, the error handling for the call to function ath10k_get_legacy_rate_idx() doesn't work because *rate_idx* is of type u8 (8 bits, unsigned), which makes it impossible for it to hold a value less than 0. Fix this by changing the type of variable *rate_idx* to s8 (8 bits, signed). Addresses-Coverity-ID: 1473914 ("Unsigned compared against 0") Fixes: 0189dbd71cbd ("ath10k: get the legacy rate index to update the txrate table") Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/ath/ath10k/htt_rx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index f240525..edd0e74 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2753,7 +2753,8 @@ ath10k_update_per_peer_tx_stats(struct ath10k *ar, struct ath10k_per_peer_tx_stats *peer_stats) { struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv; - u8 rate = 0, rate_idx = 0, sgi; + u8 rate = 0, sgi; + s8 rate_idx = 0; struct rate_info txrate; lockdep_assert_held(&ar->data_lock); -- 2.7.4