[tip: irq/drivers] irqchip/qcom-mpm: Fix potential stale power domain on probe failure
From: tip-bot2 for Guangshuo Li
Date: Tue Dec 01 2026 - 15:16:05 EST
The following commit has been merged into the irq/drivers branch of tip:
Commit-ID: 21f3995610426ef9c930b49b1e8e21eb771d8568
Gitweb: https://git.kernel.org/tip/21f3995610426ef9c930b49b1e8e21eb771d8568
Author: Guangshuo Li <liguangshuo@xxxxxxxxxxxxxxx>
AuthorDate: Tue, 01 Dec 2026 20:31:30 +08:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
CommitterDate: Tue, 01 Dec 2026 21:12:24 +01:00
irqchip/qcom-mpm: Fix potential stale power domain on probe failure
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>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>
Link: https://patch.msgid.link/20261201-52610d65e6-irqchip-qcom-mpm@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 8c575d7..79f67bb 100644
--- a/drivers/irqchip/irq-qcom-mpm.c
+++ b/drivers/irqchip/irq-qcom-mpm.c
@@ -441,7 +441,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);
@@ -473,6 +473,8 @@ remove_domain:
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;