Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp566775imw; Thu, 14 Jul 2022 06:50:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uTl6cRkJ/6HekU4nStAb6d2ctTeQMLEwY8OTSoHdj/HLsuIe0aTPqejTzJOgc+RIzcWO6V X-Received: by 2002:a63:ec47:0:b0:419:7e6d:19b5 with SMTP id r7-20020a63ec47000000b004197e6d19b5mr7899747pgj.256.1657806645728; Thu, 14 Jul 2022 06:50:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657806645; cv=none; d=google.com; s=arc-20160816; b=ywKeTyW+SNREQ2C8rNsZLAzrfy1TioejH8XUPWSrO0PaHZNFBN9vksyCB5hIA0C+Fv gvMboPR+5fXj00jMZ9EOgvAZuEz/TmXahpp639HIrbhCVU9hEwNUrgAjM1tQMm1UFW53 wV6Ldj2YJyWNbXyW8y41ZidPQRf0ogPhAmgpPOrIKkXlAR46Bv5p0q3WEUvA7BMGJEOE pr6PU3RU22n7QknCbXPw1/n3KnkowaHjQof757NqXqnSsN0Bw9pVRHlAN41OPu1S6UlN mD26kcG+gshwyznVeuwu7pPAbfl/bDDG1QwUAJT/yxeDt//PUiW06geHknXTLxNfPx26 sYlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=RV5JkL9xrBrhuUT9EJLa9v2OYrfdjlA8MGxrZdAEbmQ=; b=SvZofsmGH+5YnKoalXeKLuFQO8cTWPE+Wmcf0i9sGMfiD10y33UG0NnsxXXzSRt2nJ dNdfyQmBfaU46hiE/iKR817i2lEvsoDCdGzYGX7stYAYPMsP5oVQKNUZUHnYRjkAT0Bb Krrw8Sfb1kOIvsepj3aIxJaFxLLoKwQIiOF6FFinZnWPzgk3QuHHd9tZ6j4jnOaH1D7w +ttgaKlzNjepzkly9AeBft+NoEqk91FjGniSdwQExC/sOJkRiBEzi87xLBQXFWkO8dF/ 7Gf9tSro3qkJ1D6fDTJs7berhDVFiSlqp7km1huJJ1WQNiiZeNpJsf2HE3SOUR1zBAjt /d6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o6-20020a170902778600b0016c37fd2ed7si1821273pll.511.2022.07.14.06.50.24; Thu, 14 Jul 2022 06:50:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239554AbiGNNs6 (ORCPT + 65 others); Thu, 14 Jul 2022 09:48:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233306AbiGNNs5 (ORCPT ); Thu, 14 Jul 2022 09:48:57 -0400 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B243BE31; Thu, 14 Jul 2022 06:48:55 -0700 (PDT) Received: from rustam-GF63-Thin-9RCX.intra.ispras.ru (unknown [83.149.199.65]) by mail.ispras.ru (Postfix) with ESMTPS id A0C3140D4004; Thu, 14 Jul 2022 13:48:48 +0000 (UTC) From: Rustam Subkhankulov To: Christian Lamparter Cc: Rustam Subkhankulov , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov , ldv-project@linuxtesting.org Subject: [PATCH v2] p54: add missing parentheses in p54_flush() Date: Thu, 14 Jul 2022 16:48:31 +0300 Message-Id: <20220714134831.106004-1-subkhankulov@ispras.ru> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The assignment of the value to the variable total in the loop condition must be enclosed in additional parentheses, since otherwise, in accordance with the precedence of the operators, the conjunction will be performed first, and only then the assignment. Due to this error, a warning later in the function after the loop may not occur in the situation when it should. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Rustam Subkhankulov Fixes: 0d4171e2153b ("p54: implement flush callback") --- drivers/net/wireless/intersil/p54/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intersil/p54/main.c b/drivers/net/wireless/intersil/p54/main.c index a3ca6620dc0c..8fa3ec71603e 100644 --- a/drivers/net/wireless/intersil/p54/main.c +++ b/drivers/net/wireless/intersil/p54/main.c @@ -682,7 +682,7 @@ static void p54_flush(struct ieee80211_hw *dev, struct ieee80211_vif *vif, * queues have already been stopped and no new frames can sneak * up from behind. */ - while ((total = p54_flush_count(priv) && i--)) { + while ((total = p54_flush_count(priv)) && i--) { /* waste time */ msleep(20); } -- 2.25.1