Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e134d998 authored by Rustam Subkhankulov's avatar Rustam Subkhankulov Committed by Greg Kroah-Hartman
Browse files

wifi: p54: add missing parentheses in p54_flush()



[ 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: default avatarRustam Subkhankulov <subkhankulov@ispras.ru>
Fixes: 0d4171e2 ("p54: implement flush callback")
Acked-by: default avatarChristian Lamparter <chunkeey@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220714134831.106004-1-subkhankulov@ispras.ru


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6942c45a
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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
	 * queues have already been stopped and no new frames can sneak
	 * up from behind.
	 * up from behind.
	 */
	 */
	while ((total = p54_flush_count(priv) && i--)) {
	while ((total = p54_flush_count(priv)) && i--) {
		/* waste time */
		/* waste time */
		msleep(20);
		msleep(20);
	}
	}