Patch "net/qla3xxx: Fix a test in ql_reset_work()" has been added to the 5.17-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net/qla3xxx: Fix a test in ql_reset_work()

to the 5.17-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-qla3xxx-fix-a-test-in-ql_reset_work.patch
and it can be found in the queue-5.17 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 39b6f8ba9533de8205e9a3f4151b0abafdca365b
Author: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Date:   Sun May 15 20:07:02 2022 +0200

    net/qla3xxx: Fix a test in ql_reset_work()
    
    [ 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@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/80e73e33f390001d9c0140ffa9baddf6466a41a2.1652637337.git.christophe.jaillet@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
index b30589a135c2..06f4d9a9e938 100644
--- a/drivers/net/ethernet/qlogic/qla3xxx.c
+++ b/drivers/net/ethernet/qlogic/qla3xxx.c
@@ -3614,7 +3614,8 @@ static void ql_reset_work(struct work_struct *work)
 		qdev->mem_map_registers;
 	unsigned long hw_flags;
 
-	if (test_bit((QL_RESET_PER_SCSI | QL_RESET_START), &qdev->flags)) {
+	if (test_bit(QL_RESET_PER_SCSI, &qdev->flags) ||
+	    test_bit(QL_RESET_START, &qdev->flags)) {
 		clear_bit(QL_LINK_MASTER, &qdev->flags);
 
 		/*



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux