]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2023 06:37:16 +0000 (08:37 +0200)
commitf58c8563686bec76579e3a91d2c6acd479bda9e6
treefd4d4bf3d72ff9a1d405024a602e767b6ff49f98
parent666e7f9d60cee23077ea3e6331f6f8a19f7ea03f
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>
drivers/scsi/3w-xxxx.c