Netdev List
 help / color / mirror / Atom feed
From: Myeonghun Pak <mhun512@gmail.com>
To: Chas Williams <3chas3@gmail.com>,
	netdev@vger.kernel.org, linux-atm-general@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org, Myeonghun Pak <mhun512@gmail.com>,
	Ijae Kim <ae878000@gmail.com>
Subject: [PATCH] atm: fore200e: disable PCI device on DMA mask failure
Date: Tue, 23 Jun 2026 16:53:56 +0900	[thread overview]
Message-ID: <20260623075405.47120-1-mhun512@gmail.com> (raw)

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

             reply	other threads:[~2026-06-23  7:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23  7:53 Myeonghun Pak [this message]
2026-06-23  8:56 ` [PATCH] atm: fore200e: disable PCI device on DMA mask failure Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260623075405.47120-1-mhun512@gmail.com \
    --to=mhun512@gmail.com \
    --cc=3chas3@gmail.com \
    --cc=ae878000@gmail.com \
    --cc=linux-atm-general@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox