Patch "scsi: 3w-xxxx: Add error handling for initialization failure in tw_probe()" has been added to the 5.15-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

    scsi: 3w-xxxx: Add error handling for initialization failure in tw_probe()

to the 5.15-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:
     scsi-3w-xxxx-add-error-handling-for-initialization-f.patch
and it can be found in the queue-5.15 subdirectory.

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



commit b750275b92759977c3d66aba2fd1275874bed476
Author: Yuchen Yang <u202114568@xxxxxxxxxxx>
Date:   Fri May 5 22:12:55 2023 +0800

    scsi: 3w-xxxx: Add error handling for initialization failure in tw_probe()
    
    [ Upstream commit 2e2fe5ac695a00ab03cab4db1f4d6be07168ed9d ]
    
    Smatch complains that:
    
    tw_probe() warn: missing error code 'retval'
    
    This patch adds error checking to tw_probe() to handle initialization
    failure. If tw_reset_sequence() function returns a non-zero value, the
    function will return -EINVAL to indicate initialization failure.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Yuchen Yang <u202114568@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230505141259.7730-1-u202114568@xxxxxxxxxxx
    Reviewed-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index 4ee485ab27148..678c8ca4f699c 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -2305,8 +2305,10 @@ static int tw_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
 	TW_DISABLE_INTERRUPTS(tw_dev);
 
 	/* Initialize the card */
-	if (tw_reset_sequence(tw_dev))
+	if (tw_reset_sequence(tw_dev)) {
+		retval = -EINVAL;
 		goto out_release_mem_region;
+	}
 
 	/* Set host specific parameters */
 	host->max_id = TW_MAX_UNITS;



[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