diff options
| author | Josh Poimboeuf <[email protected]> | 2025-03-31 15:33:32 +0000 |
|---|---|---|
| committer | Mark Brown <[email protected]> | 2025-03-31 15:38:32 +0000 |
| commit | 7ba0847fa1c22e7801cebfe5f7b75aee4fae317e (patch) | |
| tree | 9d8f6f3bdfcc2e9ff76bb54b715bc97f66296a56 /net/core/lock_debug.c | |
| parent | spi: fsl-qspi: use devm function instead of driver remove (diff) | |
| download | kernel-7ba0847fa1c22e7801cebfe5f7b75aee4fae317e.tar.gz kernel-7ba0847fa1c22e7801cebfe5f7b75aee4fae317e.zip | |
spi: cadence: Fix out-of-bounds array access in cdns_mrvl_xspi_setup_clock()
If requested_clk > 128, cdns_mrvl_xspi_setup_clock() iterates over the
entire cdns_mrvl_xspi_clk_div_list array without breaking out early,
causing 'i' to go beyond the array bounds.
Fix that by stopping the loop when it gets to the last entry, clamping
the clock to the minimum 6.25 MHz.
Fixes the following warning with an UBSAN kernel:
vmlinux.o: warning: objtool: cdns_mrvl_xspi_setup_clock: unexpected end of section .text.cdns_mrvl_xspi_setup_clock
Fixes: 26d34fdc4971 ("spi: cadence: Add clock configuration for Marvell xSPI overlay")
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Link: https://lore.kernel.org/r/gs2ooxfkblnee6cc5yfcxh7nu4wvoqnuv4lrllkhccxgcac2jg@7snmwd73jkhs
Signed-off-by: Josh Poimboeuf <[email protected]>
Link: https://patch.msgid.link/h6bef6wof6zpjfp3jbhrkigqsnykdfy6j4qmmvb6gsabhianhj@k57a7hwpa3bj
Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'net/core/lock_debug.c')
0 files changed, 0 insertions, 0 deletions
