From nobody Fri Sep 5 20:19:50 2025 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 F0A98C3F6B0 for ; Tue, 23 Aug 2022 11:25:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348249AbiHWLY7 (ORCPT ); Tue, 23 Aug 2022 07:24:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357195AbiHWLSv (ORCPT ); Tue, 23 Aug 2022 07:18:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AE2A8993A; Tue, 23 Aug 2022 02:22:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 31035B81B1F; Tue, 23 Aug 2022 09:22:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DB3AC433C1; Tue, 23 Aug 2022 09:22:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661246521; bh=fQ8GGMOh4zLwx6CDpw5/MD/NznF498JGC0ZDntJHGnk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jb4jpOgi+8b/bsXFhSLYhl8oZAf0CmJyHhocXAv5vQcPEJVG8Ytsis72/BX0TcVtk /gXQ+lXtK77yG1QPPdkEh7G8DF4uB4RM+lcZAFFzwn5dw7sSStPUsJHnHi5R5FUFCK Cs45T7sepgf5+TGYLef9XTPCm5rZ6UcteJ7FwPyM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rustam Subkhankulov , Christian Lamparter , Kalle Valo , Sasha Levin Subject: [PATCH 5.4 129/389] wifi: p54: add missing parentheses in p54_flush() Date: Tue, 23 Aug 2022 10:23:27 +0200 Message-Id: <20220823080121.016141391@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080115.331990024@linuxfoundation.org> References: <20220823080115.331990024@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Rustam Subkhankulov [ Upstream commit bcfd9d7f6840b06d5988c7141127795cf405805e ] 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") Acked-by: Christian Lamparter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220714134831.106004-1-subkhankulov@ispras= .ru Signed-off-by: Sasha Levin --- 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/wireles= s/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 =3D p54_flush_count(priv) && i--)) { + while ((total =3D p54_flush_count(priv)) && i--) { /* waste time */ msleep(20); } --=20 2.35.1