diff options
author | Yuchen Yang <u202114568@hust.edu.cn> | 2023-05-05 22:12:55 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-07-19 16:21:35 +0200 |
commit | 6c1b079e266bb70c699497548e3e4c8b57e5992e (patch) | |
tree | 1de7b3d9a649e442aa58146fad4fa59f500ade11 | |
parent | 7aecdd47910c51707696e8b0e045b9f88bd4230f (diff) | |
download | linux-stable-6c1b079e266bb70c699497548e3e4c8b57e5992e.tar.gz linux-stable-6c1b079e266bb70c699497548e3e4c8b57e5992e.tar.bz2 linux-stable-6c1b079e266bb70c699497548e3e4c8b57e5992e.zip |
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@hust.edu.cn>
Link: https://lore.kernel.org/r/20230505141259.7730-1-u202114568@hust.edu.cn
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/scsi/3w-xxxx.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c index ffdecb12d654..9bd70e4618d5 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; |