diff mbox

atmel: Add missing call to pci_disable_device()

Message ID 20180523103445.8372-1-yuehaibing@huawei.com (mailing list archive)
State Accepted
Commit 88027c8ff0a3f87d5d06d53ee25a41b90d8bccec
Delegated to: Kalle Valo
Headers show

Commit Message

Yue Haibing May 23, 2018, 10:34 a.m. UTC
add pci_disable_device in error handling while init_atmel_card failed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/wireless/atmel/atmel_pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Kalle Valo May 29, 2018, 7:20 a.m. UTC | #1
YueHaibing <yuehaibing@huawei.com> wrote:

> add pci_disable_device in error handling while init_atmel_card failed.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Patch applied to wireless-drivers-next.git, thanks.

88027c8ff0a3 atmel: Add missing call to pci_disable_device()
diff mbox

Patch

diff --git a/drivers/net/wireless/atmel/atmel_pci.c b/drivers/net/wireless/atmel/atmel_pci.c
index bcf1f27..30df58a 100644
--- a/drivers/net/wireless/atmel/atmel_pci.c
+++ b/drivers/net/wireless/atmel/atmel_pci.c
@@ -61,8 +61,10 @@  static int atmel_pci_probe(struct pci_dev *pdev,
 	dev = init_atmel_card(pdev->irq, pdev->resource[1].start,
 			      ATMEL_FW_TYPE_506,
 			      &pdev->dev, NULL, NULL);
-	if (!dev)
+	if (!dev) {
+		pci_disable_device(pdev);
 		return -ENODEV;
+	}
 
 	pci_set_drvdata(pdev, dev);
 	return 0;