diff options
| author | David Carlier <devnexen@gmail.com> | 2026-08-25 23:57:29 +0100 |
|---|---|---|
| committer | Vinod Koul <vkoul@kernel.org> | 2026-10-03 17:19:28 +0200 |
| commit | fb0f0e0e9e5dace7a6d9cde289537980ad35db3d (patch) | |
| tree | 84710ae9fb9f53953a757608036ec501dfbdcbe4 /drivers/phy | |
| parent | 77a0e6ae5dec54fb6049e3ab88288bc40c81f9fd (diff) | |
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: 1781be3c8a5d ("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>
Diffstat (limited to 'drivers/phy')
| -rw-r--r-- | drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c index 7bc62a668d34..3d225c0bb80e 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c @@ -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, |
