drivers/tty/serial/qcom_geni_serial.c | 4 ---- 1 file changed, 4 deletions(-)
The SA8255P UART variants attach PM domains through
devm_pm_domain_attach_list(), which registers a devres cleanup action
to detach and free the PM domain list automatically on probe failure
or device removal.
Remove the manual dev_pm_domain_detach_list() calls from the probe
error path and remove callback. These calls can operate on memory
that has already been freed by the devres-managed cleanup, resulting
in a potential double-free. Also remove the unused pm_domain.h header.
Suggested-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Aniket Randive <aniket.randive@oss.qualcomm.com>
---
drivers/tty/serial/qcom_geni_serial.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index 3633723acef8..fe961b206645 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -20,7 +20,6 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/panic_notifier.h>
-#include <linux/pm_domain.h>
#include <linux/pm_opp.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
@@ -2008,7 +2007,6 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
DMA_RX_BUF_SIZE, DMA_FROM_DEVICE);
port->rx_dma_addr = 0;
}
- dev_pm_domain_detach_list(port->se.pd_list);
return ret;
}
@@ -2032,8 +2030,6 @@ static void qcom_geni_serial_remove(struct platform_device *pdev)
DMA_RX_BUF_SIZE, DMA_FROM_DEVICE);
port->rx_dma_addr = 0;
}
-
- dev_pm_domain_detach_list(port->se.pd_list);
}
static int __maybe_unused qcom_geni_serial_runtime_suspend(struct device *dev)
---
base-commit: 89c07d98716a13454ec3fd9f97689e812cc71bd4
change-id: 20260901-probe_cleanup_uart-60bb7d0df5ae
Best regards,
--
Aniket Randive <aniket.randive@oss.qualcomm.com>
On 26-09-01 15:20:54, Aniket Randive wrote: > The SA8255P UART variants attach PM domains through > devm_pm_domain_attach_list(), which registers a devres cleanup action > to detach and free the PM domain list automatically on probe failure > or device removal. > > Remove the manual dev_pm_domain_detach_list() calls from the probe > error path and remove callback. These calls can operate on memory > that has already been freed by the devres-managed cleanup, resulting > in a potential double-free. Also remove the unused pm_domain.h header. > > Suggested-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> > Signed-off-by: Aniket Randive <aniket.randive@oss.qualcomm.com> Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
On 9/1/26 11:50 AM, Aniket Randive wrote: > The SA8255P UART variants attach PM domains through > devm_pm_domain_attach_list(), which registers a devres cleanup action > to detach and free the PM domain list automatically on probe failure > or device removal. > > Remove the manual dev_pm_domain_detach_list() calls from the probe > error path and remove callback. These calls can operate on memory > that has already been freed by the devres-managed cleanup, resulting > in a potential double-free. Also remove the unused pm_domain.h header. > > Suggested-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> > Signed-off-by: Aniket Randive <aniket.randive@oss.qualcomm.com> > --- Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Konrad
Hi On 01-09-2026 15:20, Aniket Randive wrote: > The SA8255P UART variants attach PM domains through > devm_pm_domain_attach_list(), which registers a devres cleanup action > to detach and free the PM domain list automatically on probe failure > or device removal. > > Remove the manual dev_pm_domain_detach_list() calls from the probe > error path and remove callback. These calls can operate on memory > that has already been freed by the devres-managed cleanup, resulting > in a potential double-free. Also remove the unused pm_domain.h header. > > Suggested-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> > Signed-off-by: Aniket Randive <aniket.randive@oss.qualcomm.com> > --- > drivers/tty/serial/qcom_geni_serial.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c > index 3633723acef8..fe961b206645 100644 > --- a/drivers/tty/serial/qcom_geni_serial.c > +++ b/drivers/tty/serial/qcom_geni_serial.c > @@ -20,7 +20,6 @@ > #include <linux/module.h> > #include <linux/of.h> > #include <linux/panic_notifier.h> > -#include <linux/pm_domain.h> > #include <linux/pm_opp.h> > #include <linux/platform_device.h> > #include <linux/pm_runtime.h> > @@ -2008,7 +2007,6 @@ static int qcom_geni_serial_probe(struct platform_device *pdev) > DMA_RX_BUF_SIZE, DMA_FROM_DEVICE); > port->rx_dma_addr = 0; > } > - dev_pm_domain_detach_list(port->se.pd_list); > return ret; > } > > @@ -2032,8 +2030,6 @@ static void qcom_geni_serial_remove(struct platform_device *pdev) > DMA_RX_BUF_SIZE, DMA_FROM_DEVICE); > port->rx_dma_addr = 0; > } > - > - dev_pm_domain_detach_list(port->se.pd_list); > } > Reviewed-by: Praveen Talari <praveen.talari@oss.qualcomm.com> Thanks, Praveen Talari > static int __maybe_unused qcom_geni_serial_runtime_suspend(struct device *dev) > > --- > base-commit: 89c07d98716a13454ec3fd9f97689e812cc71bd4 > change-id: 20260901-probe_cleanup_uart-60bb7d0df5ae > > Best regards, > -- > Aniket Randive <aniket.randive@oss.qualcomm.com> >
© 2016 - 2026 Red Hat, Inc.