[PATCH 0/7] drivers: Simplify cleanup paths using __free
Andy Shevchenko
andriy.shevchenko at intel.com
Tue Mar 10 14:04:42 PDT 2026
On Wed, Mar 11, 2026 at 01:35:06AM +0530, Sanjay Chitroda wrote:
> From: Sanjay Chitroda <sanjayembeddedse at gmail.com>
>
> Hi all,
>
> This patch series replaces manual cleanup and explicit kfree() calls with
> the __free attribute from <linux/cleanup.h>. This modernizes the memory
> management style and simplifies common error paths without altering any
> functional behavior.
>
> The __free attribute provides automatic scope-based cleanup, making
> resource management clearer and reducing the chances of missing cleanup
> on early returns.
>
> No functional changes are intended in this series.
>
> Testing:
> - Compiled with W=1
> - Build-tested on i86_64
>
> Based on:
> <linux-v7.0-rc2>
>
> Feel free to share your valuable input in context of the cleanup API.
Do you put random people in the Cc list?
You may try my script [1] to see the difference.
[1]: https://github.com/andy-shev/home-bin-tools/blob/master/ge2maintainer.sh
--
With Best Regards,
Andy Shevchenko
More information about the Linux-mediatek
mailing list