* [PATCH] p54: add missing parentheses in p54_flush()
@ 2022-07-14 9:17 Rustam Subkhankulov
2022-07-14 9:45 ` Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Rustam Subkhankulov @ 2022-07-14 9:17 UTC (permalink / raw)
To: Christian Lamparter
Cc: Rustam Subkhankulov, Kalle Valo, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-wireless, netdev,
linux-kernel, Alexey Khoroshilov, ldv-project
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: d3466830c165 ("p54: move under intersil vendor directory")
---
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] p54: add missing parentheses in p54_flush()
2022-07-14 9:17 [PATCH] p54: add missing parentheses in p54_flush() Rustam Subkhankulov
@ 2022-07-14 9:45 ` Johannes Berg
2022-07-14 12:58 ` Arend Van Spriel
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2022-07-14 9:45 UTC (permalink / raw)
To: Rustam Subkhankulov, Christian Lamparter
Cc: Kalle Valo, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, linux-wireless, netdev, linux-kernel,
Alexey Khoroshilov, ldv-project
On Thu, 2022-07-14 at 12:17 +0300, Rustam Subkhankulov wrote:
> 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: d3466830c165 ("p54: move under intersil vendor directory")
>
That fixes can't be right, it just moved the code.
johannes
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] p54: add missing parentheses in p54_flush()
2022-07-14 9:45 ` Johannes Berg
@ 2022-07-14 12:58 ` Arend Van Spriel
0 siblings, 0 replies; 3+ messages in thread
From: Arend Van Spriel @ 2022-07-14 12:58 UTC (permalink / raw)
To: Johannes Berg, Rustam Subkhankulov, Christian Lamparter
Cc: Kalle Valo, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, linux-wireless, netdev, linux-kernel,
Alexey Khoroshilov, ldv-project
On 7/14/2022 11:45 AM, Johannes Berg wrote:
> On Thu, 2022-07-14 at 12:17 +0300, Rustam Subkhankulov wrote:
>> 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: d3466830c165 ("p54: move under intersil vendor directory")
>>
>
> That fixes can't be right, it just moved the code.
commit 0d4171e2153b70957fe67867420a1a24d5e4cd82
Author: Christian Lamparter <chunkeey@googlemail.com>
Date: Wed Feb 16 19:43:06 2011 +0100
p54: implement flush callback
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-07-14 12:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-14 9:17 [PATCH] p54: add missing parentheses in p54_flush() Rustam Subkhankulov
2022-07-14 9:45 ` Johannes Berg
2022-07-14 12:58 ` Arend Van Spriel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®