From: "Ethan Tidmore" <ethantidmore06@gmail.com>
To: "Oarora Etimis" <oaroraetimis@gmail.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: "Minu Jin" <s9430939@naver.com>, <linux-staging@lists.linux.dev>,
<linux-kernel@vger.kernel.org>,
"Oarora Etimis" <OaroraEtimis@gmail.com>
Subject: Re: [PATCH] staging: rtl8723bs: Use kmemdup() to replace kzalloc() followed by memcpy()
Date: Sun, 15 Mar 2026 16:36:01 -0500 [thread overview]
Message-ID: <DH3OGZTSXMY1.1D225FT4I6MGM@gmail.com> (raw)
In-Reply-To: <20260315194738.154324-1-OaroraEtimis@gmail.com>
On Sun Mar 15, 2026 at 2:47 PM CDT, Oarora Etimis wrote:
> The kzalloc() function allocates memory and zero-initializes it.
> However, in rtw_cfg80211_set_wpa_ie(), the allocated buffer is
> immediately overwritten by memcpy(). This makes the zero-initialization
> completely unnecessary, wasting CPU cycles.
>
> Use kmemdup() to simplify the code, eliminate the redundant memcpy(),
> and remove the unnecessary zeroing overhead.
>
> Signed-off-by: Oarora Etimis <OaroraEtimis@gmail.com>
> ---
This doesn't apply to staging-next.
>
> - memcpy(buf, pie, ielen);
> -
> if (ielen < RSN_HEADER_LEN) {
> - ret = -1;
> + ret = -1;
> goto exit;
> }
>
Also, this is a stray change. Keep one logical change per patch.
Thanks,
ET
prev parent reply other threads:[~2026-03-15 21:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-15 19:47 [PATCH] staging: rtl8723bs: Use kmemdup() to replace kzalloc() followed by memcpy() Oarora Etimis
2026-03-15 21:36 ` Ethan Tidmore [this message]
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=DH3OGZTSXMY1.1D225FT4I6MGM@gmail.com \
--to=ethantidmore06@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=oaroraetimis@gmail.com \
--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