[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d5f47a33-3f6d-4e18-be30-22019b84240d@web.de>
Date: Tue, 2 Sep 2025 16:34:28 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Miaoqian Lin <linmq006@...il.com>, linuxppc-dev@...ts.ozlabs.org
Cc: LKML <linux-kernel@...r.kernel.org>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Madhavan Srinivasan <maddy@...ux.ibm.com>,
Michael Ellerman <mpe@...erman.id.au>, Nicholas Piggin <npiggin@...il.com>,
Olof Johansson <olof@...om.net>
Subject: Re: [PATCH] powerpc/pasemi: Fix PCI device reference leak on error
path
> 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
Powered by blists - more mailing lists