[PATCH] irqchip/qcom-mpm: Fix potential stale power domain on probe failure
From: Guangshuo Li
Date: Tue Dec 01 2026 - 07:31:43 EST
Failures after registering the power-domain provider leave it pointing
to managed storage that probe cleanup frees. The mailbox allocation
failure also skips removing the domain itself.
Unregister the provider and remove the domain on these error paths.
This issue was found by our static analysis tool under development.
Fixes: a6199bb514d8 ("irqchip: Add Qualcomm MPM controller driver")
Signed-off-by: Guangshuo Li <liguangshuo@xxxxxxxxxxxxxxx>
---
drivers/irqchip/irq-qcom-mpm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-qcom-mpm.c b/drivers/irqchip/irq-qcom-mpm.c
index 86cc3589cdf1..94407bea184e 100644
--- a/drivers/irqchip/irq-qcom-mpm.c
+++ b/drivers/irqchip/irq-qcom-mpm.c
@@ -440,7 +440,7 @@ static int qcom_mpm_probe(struct platform_device *pdev, struct device_node *pare
if (IS_ERR(priv->mbox_chan)) {
ret = PTR_ERR(priv->mbox_chan);
dev_err(dev, "failed to acquire IPC channel: %d\n", ret);
- return ret;
+ goto remove_provider;
}
parent_domain = irq_find_host(parent);
@@ -472,6 +472,8 @@ static int qcom_mpm_probe(struct platform_device *pdev, struct device_node *pare
irq_domain_remove(priv->domain);
free_mbox:
mbox_free_channel(priv->mbox_chan);
+remove_provider:
+ of_genpd_del_provider(np);
remove_genpd:
pm_genpd_remove(genpd);
return ret;
base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244