diff options
| author | Rudi Heitbaum <rudi@heitbaum.com> | 2026-09-14 12:35:31 +0000 |
|---|---|---|
| committer | Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> | 2026-10-14 17:44:45 +0530 |
| commit | e60d0d4dfddfac3058753a1c2255251401c92dad (patch) | |
| tree | 27f6217977434277e3efe5d9439ae7c05046ed8e /scripts/basic/split-include.c | |
| parent | 2aed243fe21ec77c5682aa8ee6a5912d94b3a4ff (diff) | |
| download | linux-e60d0d4dfddfac3058753a1c2255251401c92dad.tar.gz linux-e60d0d4dfddfac3058753a1c2255251401c92dad.zip | |
PCI: imx6: Avoid dereferencing a NULL clock name
of_clk_bulk_get() leaves 'clk_bulk_data->id' as NULL for every clock that
has no matching entry in "clock-names", which is legal: a node may list
more "clocks" phandles than it names. Both scans of the bulk array
dereference that id unconditionally, so such a node oopses during probe.
The loop in imx_pcie_probe() has been wrong since it was written. The
loop in imx_setup_phy_mpll() was not: it read a fixed clks[] whose ids
came from the driver's own clk_names[] and were never NULL, and only
became wrong when the driver moved to the bulk array.
Check 'clk_bulk_data->id' before dereferencing it in both.
Fixes: f6a1fdfc78e2 ("PCI: imx6: Use devm_clk_bulk_get_all() to fetch clocks")
Fixes: d8574ce57d76 ("PCI: imx6: Add external reference clock input mode support")
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Acked-by: Richard Zhu <hongxing.zhu@nxp.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/am8iBwJSEhYhWTqk@6cfee64030a6/
Link: https://patch.msgid.link/aqfqE4OLhnN4a1lW@b65e9c1eb12f
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions
