diff options
author | Michael Neuling <mikey@neuling.org> | 2015-05-27 02:07:05 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-06-02 23:27:17 -0400 |
commit | 7f436b534d5a2277b4826e252a6f622e7986bbd3 (patch) | |
tree | 8b5ce536ec020ff5aa97a67ee8412bf27b2c6f43 /drivers/misc/cxl/pci.c | |
parent | bee30c7045847524be1b4b6b23a303c6763a96f9 (diff) |
cxl: Fix error path on probe
When probing we call pci_enable_device() but don't call pci_disable_device() on
fail. This causes refcounting issues in the PCI subsystem if a second driver
tries to bind to the same device.
This patch adds the pci_disable_device() to the probe error path. This error
path is hit when this cxl driver tries to bind to AFUs (on the vPHB) rather
than the physical device.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/misc/cxl/pci.c')
-rw-r--r-- | drivers/misc/cxl/pci.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c index 787f966f4088..4a26e5fd52c1 100644 --- a/drivers/misc/cxl/pci.c +++ b/drivers/misc/cxl/pci.c | |||
@@ -1138,6 +1138,7 @@ static int cxl_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
1138 | adapter = cxl_init_adapter(dev); | 1138 | adapter = cxl_init_adapter(dev); |
1139 | if (IS_ERR(adapter)) { | 1139 | if (IS_ERR(adapter)) { |
1140 | dev_err(&dev->dev, "cxl_init_adapter failed: %li\n", PTR_ERR(adapter)); | 1140 | dev_err(&dev->dev, "cxl_init_adapter failed: %li\n", PTR_ERR(adapter)); |
1141 | pci_disable_device(dev); | ||
1141 | return PTR_ERR(adapter); | 1142 | return PTR_ERR(adapter); |
1142 | } | 1143 | } |
1143 | 1144 | ||