diff options
author | Zicheng Qu <[email protected]> | 2024-10-22 13:43:54 +0000 |
---|---|---|
committer | Jonathan Cameron <[email protected]> | 2024-10-24 18:30:47 +0100 |
commit | 6bd301819f8f69331a55ae2336c8b111fc933f3d (patch) | |
tree | 2fcafaa1b234bb4db8e535f5e029abd30fecf506 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 795114e849ddfd48150eb0135d04748a8c81cec5 (diff) |
staging: iio: frequency: ad9832: fix division by zero in ad9832_calc_freqreg()
In the ad9832_write_frequency() function, clk_get_rate() might return 0.
This can lead to a division by zero when calling ad9832_calc_freqreg().
The check if (fout > (clk_get_rate(st->mclk) / 2)) does not protect
against the case when fout is 0. The ad9832_write_frequency() function
is called from ad9832_write(), and fout is derived from a text buffer,
which can contain any value.
Link: https://lore.kernel.org/all/2024100904-CVE-2024-47663-9bdc@gregkh/
Fixes: ea707584bac1 ("Staging: IIO: DDS: AD9832 / AD9835 driver")
Cc: [email protected]
Signed-off-by: Zicheng Qu <[email protected]>
Reviewed-by: Nuno Sa <[email protected]>
Reviewed-by: Dan Carpenter <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions