Skip to contentSkip to conversation

powerpc/pasemi: Fix error handling in pasemi_dma_init

PATCH New Miaoqian Lin 1 participant 1 message Dec 12, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/pasemi: Fix error handling in pasemi_dma_init

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")
---
 arch/powerpc/platforms/pasemi/dma_lib.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/platforms/pasemi/dma_lib.c +1 -0
index 1be1f18f6f09..b824bfe97ce8 100644
@@ -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);
Signature · 1 line
2.25.1