Re: [PATCH 08/10] iio: adc: qcom-spmi-adc5-gen3: Reject empty reg property in probe
From: Andy Shevchenko
Date: Thu Nov 19 2026 - 12:31:51 EST
On Thu, Nov 19, 2026 at 03:30:41PM +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 -EINVAL when device_property_count_u32() reports zero elements.
ENOENT is usually used for that.
--
With Best Regards,
Andy Shevchenko