Netdev List
 help / color / mirror / Atom feed
* [PATCH] atm: fore200e: disable PCI device on DMA mask failure
@ 2026-06-23  7:53 Myeonghun Pak
  2026-06-23  8:56 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: Myeonghun Pak @ 2026-06-23  7:53 UTC (permalink / raw)
  To: Chas Williams, netdev, linux-atm-general
  Cc: linux-kernel, Myeonghun Pak, Ijae Kim

fore200e_pca_detect() enables the PCI device before setting the DMA
mask. If dma_set_mask_and_coherent() fails, the current error path
returns without disabling the device.

Reuse the existing out_disable unwind label for this failure path so
pci_disable_device() is called after a successful pci_enable_device().

Fixes: ede58ef28e10 ("atm: remove deprecated use of pci api")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>

---
 drivers/atm/fore200e.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index 2423eed506..5e2cc4813e 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -2593,7 +2593,7 @@ static int fore200e_pca_detect(struct pci_dev *pci_dev,
 
     if (dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(32))) {
 	err = -EINVAL;
-	goto out;
+	goto out_disable;
     }
     
     fore200e = kzalloc_obj(struct fore200e);
-- 
2.47.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-23  8:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-23  7:53 [PATCH] atm: fore200e: disable PCI device on DMA mask failure Myeonghun Pak
2026-06-23  8:56 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox