scsi: 3w-9xxx: Avoid disabling device if failing to enable it
authorLetu Ren <fantasquex@gmail.com>
Mon, 29 Aug 2022 11:01:15 +0000 (19:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:46 +0000 (12:35 +0200)
commit9d54de866062576e2d627edcde726a7b7929f5f4
tree4f4f3a139365c776bb6c4e94fa5078437e8acfd1
parentd68da10b0cceb4177b653833e794b2923a4ffbd7
scsi: 3w-9xxx: Avoid disabling device if failing to enable it

[ Upstream commit 7eff437b5ee1309b34667844361c6bbb5c97df05 ]

The original code will "goto out_disable_device" and call
pci_disable_device() if pci_enable_device() fails. The kernel will generate
a warning message like "3w-9xxx 0000:00:05.0: disabling already-disabled
device".

We shouldn't disable a device that failed to be enabled. A simple return is
fine.

Link: https://lore.kernel.org/r/20220829110115.38789-1-fantasquex@gmail.com
Reported-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Letu Ren <fantasquex@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/3w-9xxx.c