]> git.baikalelectronics.ru Git - kernel.git/commit
net/qla3xxx: Fix a test in ql_reset_work()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 15 May 2022 18:07:02 +0000 (20:07 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 18 May 2022 00:33:13 +0000 (17:33 -0700)
commit923582f1c39ecf4e4be2e384e817443a083af818
tree4f4ff818f69fd964e2fbb004c560914a2b2b263e
parent38fc06d387c81f6b118a8a9b1f4fd5938d19fbb4
net/qla3xxx: Fix a test in ql_reset_work()

test_bit() tests if one bit is set or not.
Here the logic seems to check of bit QL_RESET_PER_SCSI (i.e. 4) OR bit
QL_RESET_START (i.e. 3) is set.

In fact, it checks if bit 7 (4 | 3 = 7) is set, that is to say
QL_ADAPTER_UP.

This looks harmless, because this bit is likely be set, and when the
ql_reset_work() delayed work is scheduled in ql3xxx_isr() (the only place
that schedule this work), QL_RESET_START or QL_RESET_PER_SCSI is set.

This has been spotted by smatch.

Fixes: 37c471ba9b41 ("[PATCH] qla3xxx NIC driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/80e73e33f390001d9c0140ffa9baddf6466a41a2.1652637337.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/qlogic/qla3xxx.c