Skip to content

Commit dec529b

Browse files
tititiou36bjorn-helgaas
authored andcommitted
PCI: switchtec: Fix an error handling path in switchtec_pci_probe()
The commit in Fixes changed the logic on how resources are released and introduced a new switchtec_exit_pci() that need to be called explicitly in order to undo a corresponding switchtec_init_pci(). This was done in the remove function, but not in the probe. Fix the probe now. Fixes: df25461 ("PCI: switchtec: Fix stdev_release() crash after surprise hot remove") Link: https://lore.kernel.org/r/01446d2ccb91a578239915812f2b7dfbeb2882af.1703428183.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 6613476 commit dec529b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/pci/switch/switchtec.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ static int switchtec_pci_probe(struct pci_dev *pdev,
16721672
rc = switchtec_init_isr(stdev);
16731673
if (rc) {
16741674
dev_err(&stdev->dev, "failed to init isr.\n");
1675-
goto err_put;
1675+
goto err_exit_pci;
16761676
}
16771677

16781678
iowrite32(SWITCHTEC_EVENT_CLEAR |
@@ -1693,6 +1693,8 @@ static int switchtec_pci_probe(struct pci_dev *pdev,
16931693

16941694
err_devadd:
16951695
stdev_kill(stdev);
1696+
err_exit_pci:
1697+
switchtec_exit_pci(stdev);
16961698
err_put:
16971699
ida_free(&switchtec_minor_ida, MINOR(stdev->dev.devt));
16981700
put_device(&stdev->dev);

0 commit comments

Comments
 (0)