Re: [PATCH v2] iio: adc: ad_sigma_delta: use __free(kfree) for temporary buffers

From: Andy Shevchenko

Date: Mon Nov 09 2026 - 12:38:51 EST


On Sun, Nov 08, 2026 at 09:15:22PM +0100, Adi Kadušić wrote:
> Replace manual kfree() calls with the __free(kfree) cleanup attribute.
> No functional change.

...

> - data = kzalloc(data_read_len + 1, GFP_KERNEL);
> + u8 *data __free(kfree) = kzalloc(data_read_len + 1, GFP_KERNEL);

Just a side note.
Would be good at some point use something from overflow.h for this.

> if (!data)
> return -ENOMEM;

--
With Best Regards,
Andy Shevchenko