From: Markus Elfring <Markus.Elfring@web.de>
To: Miaoqian Lin <linmq006@gmail.com>, linuxppc-dev@lists.ozlabs.org
Cc: LKML <linux-kernel@vger.kernel.org>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Olof Johansson <olof@lixom.net>
Subject: Re: [PATCH] powerpc/pasemi: Fix PCI device reference leak on error path
Date: Tue, 2 Sep 2025 16:34:28 +0200 [thread overview]
Message-ID: <d5f47a33-3f6d-4e18-be30-22019b84240d@web.de> (raw)
In-Reply-To: <20250829063431.1968903-1-linmq006@gmail.com>
> Fix iob_pdev reference leak in pasemi_dma_init() when dma_pdev
> allocation fails. Ensure pci_dev_put(iob_pdev) is called on
> both success and error paths.
How do you think about to increase the application of scope-based resource management?
…
> +++ b/arch/powerpc/platforms/pasemi/dma_lib.c
> @@ -530,7 +530,7 @@ int pasemi_dma_init(void)
> BUG();
> pr_warn("Can't find DMA controller\n");
> err = -ENODEV;
> - goto out;
Is it sufficient to add the function call “pci_dev_put(iob_pdev)”
in this if branch?
> + goto out_put_iob;
> }
> dma_regs = map_onedev(dma_pdev, 0);
…
Regards,
Markus
prev parent reply other threads:[~2025-09-02 14:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 6:34 [PATCH] powerpc/pasemi: Fix PCI device reference leak on error path Miaoqian Lin
2025-09-02 14:34 ` Markus Elfring [this message]
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=d5f47a33-3f6d-4e18-be30-22019b84240d@web.de \
--to=markus.elfring@web.de \
--cc=christophe.leroy@csgroup.eu \
--cc=linmq006@gmail.com \
--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 \
/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).