[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251219105928.23329-3-johan@kernel.org>
Date: Fri, 19 Dec 2025 11:59:27 +0100
From: Johan Hovold <johan@...nel.org>
To: Johan Hovold <johan@...nel.org>,
Alex Elder <elder@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Vaibhav Hiremath <hvaibhav.linux@...il.com>
Cc: greybus-dev@...ts.linaro.org,
linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] staging: greybus: arche-platform: fix memleak on probe failure
Make sure to depopulate the child devices in case of late probe
failures to avoid leaking the corresponding resources.
Fixes: fd60ac585607 ("greybus: arche-platform: Fix boot, poweroff and fw_flashing seq with APBs")
Signed-off-by: Johan Hovold <johan@...nel.org>
---
drivers/staging/greybus/arche-platform.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c
index bd069d75391b..7dcb33a6f2e3 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -523,10 +523,9 @@ static int arche_platform_probe(struct platform_device *pdev)
arche_pdata->pm_notifier.notifier_call = arche_platform_pm_notifier;
ret = register_pm_notifier(&arche_pdata->pm_notifier);
-
if (ret) {
dev_err(dev, "failed to register pm notifier %d\n", ret);
- goto err_device_remove;
+ goto err_depopulate;
}
/* Explicitly power off if requested */
@@ -547,6 +546,8 @@ static int arche_platform_probe(struct platform_device *pdev)
err_unregister_pm_notifier:
unregister_pm_notifier(&arche_pdata->pm_notifier);
+err_depopulate:
+ of_platform_depopulate(dev);
err_device_remove:
device_remove_file(&pdev->dev, &dev_attr_state);
return ret;
--
2.51.2
Powered by blists - more mailing lists