[PATCH 3/4] phy: qcom: qmp-usb-legacy: Fix possible NULL-deref on early runtime suspend

Dmitry Baryshkov dmitry.baryshkov at oss.qualcomm.com
Fri Jan 9 04:55:01 PST 2026


On Thu, Jan 08, 2026 at 04:49:43PM +0100, Loic Poulain wrote:
> There is a small window where the runtime suspend callback may run
> after pm_runtime_enable() and before pm_runtime_forbid(). In this
> case, a crash occurs because runtime suspend/resume dereferences
> qmp->phy pointer, which is not yet initialized:
>         `if (!qmp->phy->init_count) {`
> 
> Similarly to other qcom phy drivers, introduce a qmp->phy_initialized
> variable that can be used to avoid relying on the possibly uninitialized
> phy pointer.

I think these two sets of changes should be split into two different
commits.

> 
> Reorder pm_runtime_enable() and pm_runtime_forbid() to prevent the window
> where an unnecessary runtime suspend can occur.
> 
> Fixes: e464a3180a43 ("phy: qcom-qmp-usb: split off the legacy USB+dp_com support")
> Signed-off-by: Loic Poulain <loic.poulain at oss.qualcomm.com>
> ---
>  .../phy/qualcomm/phy-qcom-qmp-usb-legacy.c    | 21 ++++++++++++-------
>  1 file changed, 14 insertions(+), 7 deletions(-)
> 

-- 
With best wishes
Dmitry



More information about the linux-phy mailing list