2015-12-11 19:28:30

by Saurabh Sengar

[permalink] [raw]
Subject: [PATCH] wan: wanxl: add pci_disable_device in case of error

If there is 'no suitable DMA available' error, device should be disabled
before returning

Signed-off-by: Saurabh Sengar <[email protected]>
---
drivers/net/wan/wanxl.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c
index e73f138..a20d688 100644
--- a/drivers/net/wan/wanxl.c
+++ b/drivers/net/wan/wanxl.c
@@ -586,6 +586,7 @@ static int wanxl_pci_init_one(struct pci_dev *pdev,
if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(28)) ||
pci_set_dma_mask(pdev, DMA_BIT_MASK(28))) {
pr_err("No usable DMA configuration\n");
+ pci_disable_device(pdev);
return -EIO;
}

--
1.9.1


2015-12-14 21:22:22

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] wan: wanxl: add pci_disable_device in case of error

From: Saurabh Sengar <[email protected]>
Date: Sat, 12 Dec 2015 00:58:19 +0530

> If there is 'no suitable DMA available' error, device should be disabled
> before returning
>
> Signed-off-by: Saurabh Sengar <[email protected]>

Applied to net-next, thanks.