]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
scsi: 3w-xxxx: Add error handling for initialization failure in tw_probe()
authorYuchen Yang <u202114568@hust.edu.cn>
Fri, 5 May 2023 14:12:55 +0000 (22:12 +0800)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Mon, 2 Oct 2023 15:19:48 +0000 (17:19 +0200)
commitef2ae8eeac19b6d233821115a5d9414e0da41d14
tree97a3ea471512338ac7c1cb0ea7f0476900cda963
parent014b2e7250438c9856d95c49e9eb28141d4147bd
scsi: 3w-xxxx: Add error handling for initialization failure in tw_probe()

BugLink: https://bugs.launchpad.net/bugs/2034469
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/scsi/3w-xxxx.c