Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22f49d9d authored by Letu Ren's avatar Letu Ren Committed by Greg Kroah-Hartman
Browse files

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: default avatarZheyu Ma <zheyuma97@gmail.com>
Signed-off-by: default avatarLetu Ren <fantasquex@gmail.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 66de9220
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2014,7 +2014,7 @@ static int twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
	retval = pci_enable_device(pdev);
	retval = pci_enable_device(pdev);
	if (retval) {
	if (retval) {
		TW_PRINTK(host, TW_DRIVER, 0x34, "Failed to enable pci device");
		TW_PRINTK(host, TW_DRIVER, 0x34, "Failed to enable pci device");
		goto out_disable_device;
		return -ENODEV;
	}
	}


	pci_set_master(pdev);
	pci_set_master(pdev);