From f52ddaf5e771c753663a719834848fde92b219f8 Mon Sep 17 00:00:00 2001 From: Pengpeng Hou Date: Tue, 16 Jun 2026 08:47:41 +0800 Subject: [PATCH] firmware: ti_sci: Undo list publication on populate failure ti_sci_probe() publishes the controller on the global ti_sci_list before creating child devices. If of_platform_populate() fails after creating some children, the probe error path leaves the children around and leaves the failed controller visible through ti_sci_get_handle(). Depopulate any children created by the failed populate call and remove the controller from the global list before returning the probe error. Signed-off-by: Pengpeng Hou Link: https://patch.msgid.link/20260616004741.1726-1-pengpeng@iscas.ac.cn Signed-off-by: Nishanth Menon --- drivers/firmware/ti_sci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 590a464403c5..cc747ab0237f 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -4225,6 +4225,10 @@ static int ti_sci_probe(struct platform_device *pdev) ret = of_platform_populate(dev->of_node, NULL, NULL, dev); if (ret) { dev_err(dev, "platform_populate failed %pe\n", ERR_PTR(ret)); + of_platform_depopulate(dev); + mutex_lock(&ti_sci_list_mutex); + list_del(&info->node); + mutex_unlock(&ti_sci_list_mutex); goto out; } return 0;