From: Miaoqian Lin <linmq006@gmail.com>
To: Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
Miaoqian Lin <linmq006@gmail.com>,
Olof Johansson <olof@lixom.net>, Jeff Garzik <jeff@garzik.org>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: [PATCH] powerpc/pasemi: Fix error handling in pasemi_dma_init
Date: Fri, 12 Dec 2025 13:05:01 +0400 [thread overview]
Message-ID: <20251212090503.2447465-1-linmq006@gmail.com> (raw)
Add missing pci_dev_put(iob_pdev) to drop the reference count
obtained by pci_get_device() in case of error.
Found via static analysis and code review.
Fixes: 8ee9d8577935 ("pasemi: DMA engine management library")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
arch/powerpc/platforms/pasemi/dma_lib.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/platforms/pasemi/dma_lib.c b/arch/powerpc/platforms/pasemi/dma_lib.c
index 1be1f18f6f09..b824bfe97ce8 100644
--- a/arch/powerpc/platforms/pasemi/dma_lib.c
+++ b/arch/powerpc/platforms/pasemi/dma_lib.c
@@ -530,6 +530,7 @@ int pasemi_dma_init(void)
BUG();
pr_warn("Can't find DMA controller\n");
err = -ENODEV;
+ pci_dev_put(iob_pdev);
goto out;
}
dma_regs = map_onedev(dma_pdev, 0);
--
2.25.1
reply other threads:[~2025-12-12 9:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20251212090503.2447465-1-linmq006@gmail.com \
--to=linmq006@gmail.com \
--cc=chleroy@kernel.org \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=olof@lixom.net \
--cc=stable@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;
as well as URLs for NNTP newsgroup(s).