]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 7 Sep 2022 02:22:24 +0000 (22:22 -0400)
commitef222f4f63e9ce97d371ecd0f2fd2059a7b7f64c
tree4693dba47b941a182745c7739172870a21746d27
parent185d5f86d105e9eb90e7cf3cb8dfc43abc8f4ba1
scsi: 3w-9xxx: Avoid disabling device if failing to enable it

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>
drivers/scsi/3w-9xxx.c