Re: [PATCH v4 1/4] iio: adc: ad799x: make rx_buf static
From: Andy Shevchenko
Date: Sun Mar 08 2026 - 17:10:38 EST
On Sun, Mar 08, 2026 at 11:58:08PM +0530, Archit Anant wrote:
> Currently, rx_buf is dynamically allocated using kmalloc() every time
> ad799x_update_scan_mode() is called. This can lead to memory leaks if
> the scan mask is updated multiple times.
>
> Drop the dynamic allocation and replace it with a static, buffer
> using IIO_DECLARE_BUFFER_WITH_TS().This eliminates the allocation
Missing space after period.
> overhead, prevents leaks, and removes the need for manual kfree()
> on driver removal.
Code wise LGTM.
--
With Best Regards,
Andy Shevchenko