]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 10 Aug 2022 07:22:39 +0000 (09:22 +0200)
commit2396a7d8c9fcb12e25d20a0795cf6ce7a8662665
tree2507e58afb32b82de7378afce866cdf7c0b9ec42
parent12b66bad6a9bcda029d11bd1ad37cf827703da0e
net/qla3xxx: Fix a test in ql_reset_work()

BugLink: https://bugs.launchpad.net/bugs/1981375
[ Upstream commit 5361448e45fac6fb96738df748229432a62d78b6 ]

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: 5a4faa873782 ("[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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/qlogic/qla3xxx.c