Re: [PATCH v3] iio: adc: ad7768-1: Fix ERR_PTR dereference in ad7768_fill_scale_tbl

From: Andy Shevchenko

Date: Mon Feb 16 2026 - 02:36:15 EST


On Sat, Feb 14, 2026 at 12:46:37PM -0600, Ethan Tidmore wrote:
> The function iio_get_current_scan_type() can return an 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.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>

--
With Best Regards,
Andy Shevchenko