Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: df25461119d9 ("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 <christophe.jaillet@wanadoo.fr>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

authored by

Christophe JAILLET and committed by
Bjorn Helgaas
dec529b0 6613476e

+3 -1
+3 -1
drivers/pci/switch/switchtec.c
··· 1672 1672 rc = switchtec_init_isr(stdev); 1673 1673 if (rc) { 1674 1674 dev_err(&stdev->dev, "failed to init isr.\n"); 1675 - goto err_put; 1675 + goto err_exit_pci; 1676 1676 } 1677 1677 1678 1678 iowrite32(SWITCHTEC_EVENT_CLEAR | ··· 1693 1693 1694 1694 err_devadd: 1695 1695 stdev_kill(stdev); 1696 + err_exit_pci: 1697 + switchtec_exit_pci(stdev); 1696 1698 err_put: 1697 1699 ida_free(&switchtec_minor_ida, MINOR(stdev->dev.devt)); 1698 1700 put_device(&stdev->dev);