Re: [PATCH v2] iio: ssp_sensors: simplify cleanup using __free

From: Andy Shevchenko

Date: Wed Mar 11 2026 - 16:24:49 EST


On Wed, Mar 11, 2026 at 7:41 PM Sanjay Chitroda
<sanjayembeddedse@xxxxxxxxx> wrote:
>
> From: Sanjay Chitroda <sanjayembeddedse@xxxxxxxxx>
>
> Replace manual cleanup logic with __free attribute from cleanup.h. This
> removes explicit kfree() calls and simplifies the error handling paths.
>
> No functional change intended for kmalloc().

> ---
> Changes in v2:
> - split series to individual patch
> - address review comment from Andy Shevchenko
> - Link to v1 https://lore.kernel.org/all/20260310200513.2162018-3-sanjayembedded@xxxxxxxxx/

Yeah, but what about other comments?

First of all, consider using guard()() and friends as a prerequisite
to this change. Second, look at the code for the absence of goto:s out
of the scoped blocks. Third, does this driver use some buffer in the
existing structure like ST drivers? Perhaps the same approach can be
applied?


--
With Best Regards,
Andy Shevchenko