Thread (2 messages) 2 messages, 2 authors, 2025-09-02

Re: [PATCH] powerpc/pasemi: Fix PCI device reference leak on error path

From: Markus Elfring <hidden>
Date: 2025-09-02 14:34:57
Also in: lkml

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?


…
quoted hunk ↗ jump to hunk
+++ 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help