public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Minu Jin <s9430939@naver.com>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: use kzalloc directly in _rtw_zmalloc
Date: Tue, 20 Jan 2026 16:38:55 +0100	[thread overview]
Message-ID: <2026012000-parlor-blissful-dc5d@gregkh> (raw)
In-Reply-To: <20260120054036.3783680-1-s9430939@naver.com>

On Tue, Jan 20, 2026 at 02:40:36PM +0900, Minu Jin wrote:
> Replace kmalloc + memset with kzalloc for simpler and cleaner code.
> 
> Signed-off-by: Minu Jin <s9430939@naver.com>
> ---
>  drivers/staging/rtl8723bs/os_dep/osdep_service.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/os_dep/osdep_service.c b/drivers/staging/rtl8723bs/os_dep/osdep_service.c
> index a00f9f0c85c5..be46132a533a 100644
> --- a/drivers/staging/rtl8723bs/os_dep/osdep_service.c
> +++ b/drivers/staging/rtl8723bs/os_dep/osdep_service.c
> @@ -24,12 +24,7 @@ void *_rtw_malloc(u32 sz)
>  
>  void *_rtw_zmalloc(u32 sz)
>  {
> -	void *pbuf = _rtw_malloc(sz);
> -
> -	if (pbuf)
> -		memset(pbuf, 0, sz);
> -
> -	return pbuf;
> +	return kzalloc(sz, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);

So there is now no more calles to _rtw_malloc(), so why is it left in
here?  Oh wait, it's a wrapper for nothing?  Odd.

And the in_interrupt() check really doesn't work, that shouldn't be
used.

And finally, try to just replace the callers with the real call to
kzalloc, don't propagate this mess any more, the wrapper needs to be
removed entirely.

Same for probably all functions in this file, right?

thanks,

greg k-h

  reply	other threads:[~2026-01-20 15:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20  5:40 [PATCH] staging: rtl8723bs: use kzalloc directly in _rtw_zmalloc Minu Jin
2026-01-20 15:38 ` Greg KH [this message]
2026-01-22  6:20 ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026012000-parlor-blissful-dc5d@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=s9430939@naver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox