Re: [PATCH v3 2/3] iio: adc: qcom-spmi-adc5-gen3: Reject empty reg property in probe

From: Andy Shevchenko

Date: Thu Dec 03 2026 - 06:44:33 EST


On Wed, Dec 02, 2026 at 08:21:11PM +0000, Lee Jones wrote:
> If a firmware node supplies an empty reg property,
> device_property_count_u32() returns 0, which passes the negative error
> check in adc5_gen3_probe() and leaves num_sdams set to 0. Subsequent
> zero-length allocations return ZERO_SIZE_PTR, which is then dereferenced
> when requesting the VADC SDAM interrupt, and num_sdams * 8 - 1 wraps in
> unsigned comparisons when counting TM channels.
>
> Return -ENOENT when device_property_count_u32() reports zero elements.

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

--
With Best Regards,
Andy Shevchenko