public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Minu Jin <s9430939@naver.com>
Cc: gregkh@linuxfoundation.org, andy@kernel.org,
	dan.carpenter@linaro.org, trohan2000@gmail.com,
	straube.linux@gmail.com, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/5] staging: rtl8723bs: introduce kmemdup() where applicable
Date: Wed, 4 Feb 2026 12:16:27 +0200	[thread overview]
Message-ID: <aYMce65kLITLyoq5@smile.fi.intel.com> (raw)
In-Reply-To: <20260204064455.1379342-2-s9430939@naver.com>

On Wed, Feb 04, 2026 at 03:44:50PM +0900, Minu Jin wrote:
> Replace memory allocation followed by memcpy() with kmemdup() to simplify
> the code and improve readability.

Right, thanks for this change!

My comments below.

First of all, you also need to add a note why GFP_ATOMIC.

...

> +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)

>  		spin_lock_bh(&pstat->lock);
>  		kfree(pstat->passoc_req);
>  		pstat->assoc_req_len = 0;
> -		pstat->passoc_req =  rtw_zmalloc(pkt_len);
> +		pstat->passoc_req = kmemdup(pframe, pkt_len, GFP_ATOMIC);
>  		if (pstat->passoc_req) {
> -			memcpy(pstat->passoc_req, pframe, pkt_len);
>  			pstat->assoc_req_len = pkt_len;
>  		}

Now {} should be also removed.

...

The rest LGTM.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-02-04 10:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04  6:44 [PATCH v5 0/5] staging: rtl8723bs: replace custom wrappers with kernel APIs Minu Jin
2026-02-04  6:44 ` [PATCH v5 1/5] staging: rtl8723bs: introduce kmemdup() where applicable Minu Jin
2026-02-04 10:16   ` Andy Shevchenko [this message]
2026-02-04  6:44 ` [PATCH v5 2/5] staging: rtl8723bs: replace rtw_malloc() with kmalloc() Minu Jin
2026-02-04 10:21   ` Andy Shevchenko
2026-02-04  6:44 ` [PATCH v5 3/5] staging: rtl8723bs: replace rtw_zmalloc() with kzalloc() Minu Jin
2026-02-04 10:27   ` Andy Shevchenko
2026-02-04  6:44 ` [PATCH v5 4/5] staging: rtl8723bs: use standard skb allocation APIs Minu Jin
2026-02-04 10:28   ` Andy Shevchenko
2026-02-04  6:44 ` [PATCH v5 5/5] staging: rtl8723bs: remove unused allocation wrapper functions Minu Jin
2026-02-04 10:29   ` Andy Shevchenko

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=aYMce65kLITLyoq5@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=s9430939@naver.com \
    --cc=straube.linux@gmail.com \
    --cc=trohan2000@gmail.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