From: Michael Neuling Date: Wed, 27 May 2015 06:07:05 +0000 (+1000) Subject: cxl: Fix error path on probe X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7f436b534d5a2277b4826e252a6f622e7986bbd3;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Acked-by: Ian Munsie Signed-off-by: Michael Ellerman --- 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) adapter = cxl_init_adapter(dev); if (IS_ERR(adapter)) { dev_err(&dev->dev, "cxl_init_adapter failed: %li\n", PTR_ERR(adapter)); + pci_disable_device(dev); return PTR_ERR(adapter); }