Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: filter: admv8818: fix integer overflow

HZ_PER_MHZ is only unsigned long. This math overflows, leading to
incorrect results.

Fixes: f34fe888ad05 ("iio:filter:admv8818: add support for ADMV8818")
Signed-off-by: Sam Winchenbach <swinchenbach@arka.org>
Link: https://patch.msgid.link/20250328174831.227202-4-sam.winchenbach@framepointer.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Sam Winchenbach and committed by
Jonathan Cameron
fb6009a2 ef0ce24f

+1 -1
+1 -1
drivers/iio/filter/admv8818.c
··· 154 154 } 155 155 156 156 /* Close HPF frequency gap between 12 and 12.5 GHz */ 157 - if (freq >= 12000 * HZ_PER_MHZ && freq <= 12500 * HZ_PER_MHZ) { 157 + if (freq >= 12000ULL * HZ_PER_MHZ && freq < 12500ULL * HZ_PER_MHZ) { 158 158 hpf_band = 3; 159 159 hpf_step = 15; 160 160 }