phy: qcom: qmp-pcie: Check clock-output-names count in the multi-PHY driver

of_property_count_strings() returns a negative errno when the property
is missing or malformed. The value was passed straight to
devm_kcalloc(), whose overflow check rejected it, turning a device tree
problem into a bogus -ENOMEM with no diagnostic.

Fixes: 1781be3c8a ("phy: qcom: qmp-pcie: Add QMP PCIe Multi-PHY driver")
Signed-off-by: David Carlier <devnexen@gmail.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20260825225729.230493-2-devnexen@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
David Carlier 2026-08-25 23:57:29 +01:00 committed by Vinod Koul
parent 77a0e6ae5d
commit fb0f0e0e9e

View File

@ -1357,7 +1357,8 @@ static int qmp_pcie_multiphy_register_clocks(struct device *dev,
num_pipe_outputs = of_property_count_strings(np, "clock-output-names");
if (num_pipe_outputs < 0)
return num_pipe_outputs;
return dev_err_probe(dev, num_pipe_outputs,
"failed to read clock-output-names\n");
qmp_data->num_pipe_outputs = num_pipe_outputs;
qmp_data->pipe_out_clks = devm_kcalloc(dev, num_pipe_outputs,