summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLetu Ren <fantasquex@gmail.com>2022-08-29 19:01:15 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-10-26 13:19:40 +0200
commit37b679f8b5387a7d7bfbf30bec21c0f38da3abcc (patch)
tree3fa5c4a8f604068441446722457aa8133e05155b
parent4befc7ffa18ef9a4b70d854465313a345a06862f (diff)
downloadlinux-stable-37b679f8b5387a7d7bfbf30bec21c0f38da3abcc.tar.gz
linux-stable-37b679f8b5387a7d7bfbf30bec21c0f38da3abcc.tar.bz2
linux-stable-37b679f8b5387a7d7bfbf30bec21c0f38da3abcc.zip
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>
-rw-r--r--drivers/scsi/3w-9xxx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index 27521fc3ef5a..ea2cd8ecc3a5 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -2009,7 +2009,7 @@ static int twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
retval = pci_enable_device(pdev);
if (retval) {
TW_PRINTK(host, TW_DRIVER, 0x34, "Failed to enable pci device");
- goto out_disable_device;
+ return -ENODEV;
}
pci_set_master(pdev);