Re: [PATCH v2] iio: adc: ad7768-1: Fix ERR_PTR dereference in ad7768_fill_scale_tbl
From: Ethan Tidmore
Date: Fri Feb 13 2026 - 15:11:46 EST
On Fri Feb 13, 2026 at 1:51 PM CST, Ethan Tidmore wrote:
> The function iio_get_current_scan_type() can return aan error pointer,
> the return value scan_type is not checked for this and immediately
> dereferenced which can cause a kernel panic.
>
> Add check for IS_ERR() and propagate the error back.
>
> Fixes: ff085189cb17 ("iio: adc: ad7768-1: add support for ADAQ776x-1 ADC Family")
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Reported-by: Dan Carpenter <error27@xxxxxxxxx>
> Closes: https://lore.kernel.org/r/202602051234.5gArzLyZ-lkp@xxxxxxxxx/
> Signed-off-by: Ethan Tidmore <ethantidmore06@xxxxxxxxx>
> ---
Sorry, ignore this v2. Just noticed typo "aan" and forgot changelog.
Will send v3 tomorrow with these two things fixed.
Thanks,
ET