[PATCH 7/7] staging: rtl8723bs: simplify cleanup using __free
Andrew Lunn
andrew at lunn.ch
Tue Mar 10 14:42:17 PDT 2026
On Wed, Mar 11, 2026 at 01:35:13AM +0530, Sanjay Chitroda wrote:
> From: Sanjay Chitroda <sanjayembeddedse at gmail.com>
>
> 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().
>
> Signed-off-by: Sanjay Chitroda <sanjayembeddedse at gmail.com>
> ---
> .../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 13 ++-----
> drivers/staging/rtl8723bs/hal/sdio_ops.c | 37 ++++---------------
> 2 files changed, 11 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
> index 8d259820f103..2badf7d1aec4 100644
> --- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
rtl8723bs is a networking device.
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
says:
Low level cleanup constructs (such as __free()) can be used when
building APIs and helpers, especially scoped iterators. However,
direct use of __free() within networking core and drivers is
discouraged.
Please drop this patch.
You might also want to check other subsystems and see if they have
similar policies for these magic operators.
Andrew
More information about the Linux-mediatek
mailing list