[PATCH 11/28] mfd: intel-lpss: Remove registered MFD child devices on probe failure

From: Lee Jones

Date: Wed Oct 21 2026 - 08:24:16 EST


When intel_lpss_has_idma() is true, intel_lpss_probe() registers the
iDMA64 child device via mfd_add_devices() before registering the host
controller cell. If the second mfd_add_devices() call fails, the
err_remove_ltr error path returns without calling mfd_remove_devices(),
leaving the iDMA64 child device registered after the parent's
device-managed resources are freed.

Call mfd_remove_devices() on the probe error path to clean up any
previously registered MFD child devices, matching intel_lpss_remove().

Fixes: 4b45efe85263 ("mfd: Add support for Intel Sunrisepoint LPSS devices")
Closes: https://sashiko.dev/#/bug/linux-b0ba1dea-0272-491a-a1aa-2fd27c5eb9b0
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
---
drivers/mfd/intel-lpss.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
index 63d6694f7145..657b1e3fb896 100644
--- a/drivers/mfd/intel-lpss.c
+++ b/drivers/mfd/intel-lpss.c
@@ -455,6 +455,7 @@ int intel_lpss_probe(struct device *dev,
return 0;

err_remove_ltr:
+ mfd_remove_devices(dev);
intel_lpss_debugfs_remove(lpss);
intel_lpss_ltr_hide(lpss);
intel_lpss_unregister_clock(lpss);
--
2.56.0.218.g1ec904b173-goog