]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
scsi: mpt3sas: Fix error return value in _scsih_expander_add()
authorZhen Lei <thunder.leizhen@huawei.com>
Fri, 14 May 2021 08:13:00 +0000 (16:13 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 13 Aug 2021 07:31:30 +0000 (09:31 +0200)
commit3a9331f3f0d6968a35566b9cf2ba291bbe854ee2
tree2b27c734f6e43f2667976f7d4cdd96c905585bb5
parentc996f9e36fa98f03f7354a48a94c71ce73b0365a
scsi: mpt3sas: Fix error return value in _scsih_expander_add()

BugLink: https://bugs.launchpad.net/bugs/1938340
[ Upstream commit d6c2ce435ffe23ef7f395ae76ec747414589db46 ]

When an expander does not contain any 'phys', an appropriate error code -1
should be returned, as done elsewhere in this function. However, we
currently do not explicitly assign this error code to 'rc'. As a result, 0
was incorrectly returned.

Link: https://lore.kernel.org/r/20210514081300.6650-1-thunder.leizhen@huawei.com
Fixes: f92363d12359 ("[SCSI] mpt3sas: add new driver supporting 12GB SAS")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
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/mpt3sas/mpt3sas_scsih.c