From: Kulikov Vasiliy <segooon@gmail.com>
Date: Mon, 9 Aug 2010 19:51:44 +0000 (+0400)
Subject: staging: crystalhd: call disable_pci_device() if pci_probe() failed
X-Git-Tag: firefly_0821_release~7613^2~3583^2~3^2~773
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=036b00e0917a867a018c583aa86aa66affb9321c;p=firefly-linux-kernel-4.4.55.git

staging: crystalhd: call disable_pci_device() if pci_probe() failed

Driver should call disable_pci_device() if it returns from pci_probe()
with error.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---

diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
index fbb80f09a3d9..115e79b8b4eb 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -570,6 +570,7 @@ static int __devinit chd_dec_pci_probe(struct pci_dev *pdev,
 	rc = chd_pci_reserve_mem(pinfo);
 	if (rc) {
 		BCMLOG_ERR("Failed to setup memory regions.\n");
+		pci_disable_device(pdev);
 		return -ENOMEM;
 	}