aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gcc-plugins/randomize_layout_plugin.c
diff options
context:
space:
mode:
authorDevyn Liu <[email protected]>2024-07-30 03:20:40 +0000
committerMark Brown <[email protected]>2024-07-30 12:27:38 +0000
commit5127c42c77de18651aa9e8e0a3ced190103b449c (patch)
treeb1a5479a03f7b3cbf10850bead31560693086171 /scripts/gcc-plugins/randomize_layout_plugin.c
parentspi: hisi-kunpeng: Add validation for the minimum value of speed_hz (diff)
downloadkernel-5127c42c77de18651aa9e8e0a3ced190103b449c.tar.gz
kernel-5127c42c77de18651aa9e8e0a3ced190103b449c.zip
spi: hisi-kunpeng: Add verification for the max_frequency provided by the firmware
If the value of max_speed_hz is 0, it may cause a division by zero error in hisi_calc_effective_speed(). The value of max_speed_hz is provided by firmware. Firmware is generally considered as a trusted domain. However, as division by zero errors can cause system failure, for defense measure, the value of max_speed is validated here. So 0 is regarded as invalid and an error code is returned. Signed-off-by: Devyn Liu <[email protected]> Reviewed-by: Jay Fang <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'scripts/gcc-plugins/randomize_layout_plugin.c')
0 files changed, 0 insertions, 0 deletions