Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wifi: p54: add missing parentheses in p54_flush()

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

authored by

Rustam Subkhankulov and committed by
Kalle Valo
bcfd9d7f 68204a69

+1 -1
+1 -1
drivers/net/wireless/intersil/p54/main.c
··· 683 683 * queues have already been stopped and no new frames can sneak 684 684 * up from behind. 685 685 */ 686 - while ((total = p54_flush_count(priv) && i--)) { 686 + while ((total = p54_flush_count(priv)) && i--) { 687 687 /* waste time */ 688 688 msleep(20); 689 689 }