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

From: Andy Shevchenko

Date: Fri Feb 13 2026 - 04:23:17 EST


On Thu, Feb 12, 2026 at 09:12:07PM -0600, Ethan Tidmore wrote:
> The function iio_get_current_scan_type() can return ERR_PTR, the return

ERR_PTR --> error pointer

> value scan_type is not checked for this and immediately dereferenced
> which can cause a kernel panic.
>
> Add check for IS_ERR() and return early to avoid crash.

Also check lore.kernel.org archive, I believe there were reports from CI and
bots on this issue already (hence might need Reported-by & Closed-by tags).

--
With Best Regards,
Andy Shevchenko