[PATCH v9 2/2] phy: qcom-mipi-csi2: Add a CSI2 MIPI DPHY driver

Wenmeng Liu wenmeng.liu at oss.qualcomm.com
Wed Jul 8 00:57:38 PDT 2026


Hi Bryan,

On 7/8/2026 7:39 AM, Bryan O'Donoghue wrote:
> +
> +static int phy_qcom_mipi_csi2_attach_pm_domains(struct mipi_csi2phy_device *csi2phy)
> +{
> +	struct dev_pm_domain_attach_data pd_data;
> +	const char **pd_names;
> +	int i;
> +
> +	pd_names = devm_kzalloc(csi2phy->dev,
> +				sizeof(char *) * csi2phy->soc_cfg->num_genpds,
> +				GFP_KERNEL);
> +	if (!pd_names)
> +		return -ENOMEM;
> +
> +	for (i = 0; i < csi2phy->soc_cfg->num_genpds; i++)
> +		pd_names[i] = csi2phy->soc_cfg->genpds[i].name;
> +
> +	pd_data.pd_names = pd_names;
> +	pd_data.num_pd_names = csi2phy->soc_cfg->num_genpds;

Please also initialize pd_data.pd_flags.

pd_data is not fully initialized before use. Since pd_flags is never 
assigned, it may contain stale stack data and affect 
devm_pm_domain_attach_list() behavior.

> +
> +	return devm_pm_domain_attach_list(csi2phy->dev, &pd_data,
> +					  &csi2phy->pd_list);
> +}
> +


Thanks,
Wenmeng



More information about the linux-phy mailing list