Skip to contentSkip to conversation

scsi/3w-9xxx: Avoid disabling device if failing to enable it

PATCH Applied Letu Ren 2 participants 2 messages Aug 29, 2022 – Sep 7, 2022

Subsystems (2)
lore
Share & tools
lore

Letu Ren

author
#0 lore raw

PATCH 1/1 scsi/3w-9xxx: Avoid disabling device if failing to enable it

The original code will goto out_disable_device and pci_disable_device if pci_enable_device fails. Kernel will generate a warning message "3w-9xxx 0000:00:05.0: disabling already-disabled device". We shouldn't disable a failed to enable device. A simple return is fine.

---
 drivers/scsi/3w-9xxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/3w-9xxx.c +1 -1
index cd823ff5deab..6cb9cca9565b 100644
@@ -2006,7 +2006,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);
Signature · 1 line
2.37.2
#1 lore raw

Letu,

Quoted 5 lines

The original code will goto out_disable_device and pci_disable_device if pci_enable_device fails. Kernel will generate a warning message "3w-9xxx 0000:00:05.0: disabling already-disabled device". We shouldn't disable a failed to enable device. A simple return is fine.

Applied to 6.1/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering