Devyn Liu 5127c42c77
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 <liudingyuan@huawei.com>
Reviewed-by: Jay Fang <f.fangjian@huawei.com>
Link: https://patch.msgid.link/20240730032040.3156393-3-liudingyuan@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-30 13:27:38 +01:00
..
2024-07-08 17:01:10 +01:00
2024-07-08 17:01:10 +01:00
2024-07-15 18:03:43 -07:00
2024-07-08 17:01:10 +01:00
2024-06-25 20:04:31 +01:00
2024-02-13 15:48:22 +00:00
2024-07-15 18:03:43 -07:00
2024-03-18 17:30:46 +00:00
2024-06-11 11:38:25 +01:00
2023-08-21 14:29:37 +01:00
2024-07-05 18:47:46 +01:00
2024-07-25 10:42:22 -07:00