scsi: mpt3sas: Fix error returns in BRM_status_show
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Wed, 1 Jul 2020 13:14:54 +0000 (22:14 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jul 2020 08:19:36 +0000 (10:19 +0200)
commit0d048a75ae0a6474e39ea7a9a35fb8dba489d0ad
tree687a7a1c8fdb24cdf5f05fbcdd22ce4e809a3429
parent6e783a84f903e9f20dc34a4034f015b3a69d86ad
scsi: mpt3sas: Fix error returns in BRM_status_show

[ Upstream commit 0fd181456aa0826057adbfb6c79c40f4083cfd75 ]

BRM_status_show() has several error branches, but none of them record the
error in the error return.

Also while at it remove the manual mutex_unlock() of the pci_access_mutex
in case of an ongoing pci error recovery or host removal and jump to the
cleanup label instead.

Note: We can safely jump to out from here as io_unit_pg3 is initialized to
NULL and if it hasn't been allocated, kfree() skips the NULL pointer.

[mkp: compilation warning]

Link: https://lore.kernel.org/r/20200701131454.5255-1-johannes.thumshirn@wdc.com
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Acked-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/mpt3sas/mpt3sas_ctl.c