Commit 09113ab
nvme-pci: fix error handling in nvme_pci_enable()
There are two issues in nvme_pci_enable():
1) If pci_alloc_irq_vectors() fails, device is left enabled. Fix this by
adding a goto disable statement.
2) nvme_pci_configure_admin_queue could return -ENODEV, in this case,
we will need to free IRQ properly. Otherwise the following warning
could be triggered:
[ 5.286752] WARNING: CPU: 0 PID: 33 at kernel/irq/irqdomain.c:253 irq_domain_remove+0x12d/0x140
[ 5.290547] Call Trace:
[ 5.290626] <TASK>
[ 5.290695] msi_remove_device_irq_domain+0xc9/0xf0
[ 5.290843] msi_device_data_release+0x15/0x80
[ 5.290978] release_nodes+0x58/0x90
[ 5.293788] WARNING: CPU: 0 PID: 33 at kernel/irq/msi.c:276 msi_device_data_release+0x76/0x80
[ 5.297573] Call Trace:
[ 5.297651] <TASK>
[ 5.297719] release_nodes+0x58/0x90
[ 5.297831] devres_release_all+0xef/0x140
[ 5.298339] device_unbind_cleanup+0x11/0xc0
[ 5.298479] really_probe+0x296/0x320
Fixes: a6ee7f1 ("nvme-pci: call nvme_pci_configure_admin_queue from nvme_pci_enable")
Co-developed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>1 parent 453116a commit 09113ab
1 file changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2533 | 2533 | | |
2534 | 2534 | | |
2535 | 2535 | | |
2536 | | - | |
| 2536 | + | |
2537 | 2537 | | |
2538 | 2538 | | |
2539 | 2539 | | |
| |||
2586 | 2586 | | |
2587 | 2587 | | |
2588 | 2588 | | |
2589 | | - | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
2590 | 2593 | | |
| 2594 | + | |
| 2595 | + | |
2591 | 2596 | | |
2592 | 2597 | | |
2593 | 2598 | | |
| |||
0 commit comments