From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Tomasz Unger <tomasz.unger@yahoo.pl>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: replace kmalloc + memcpy with kmemdup in ioctl_cfg80211.c
Date: Sat, 14 Mar 2026 11:00:13 +0100 [thread overview]
Message-ID: <2026031426-datebook-evolve-ed6b@gregkh> (raw)
In-Reply-To: <20260314-rtl8723bs-kmemdup-v1-1-8280a436f20c@yahoo.pl>
On Sat, Mar 14, 2026 at 10:11:39AM +0100, Tomasz Unger wrote:
> Replace kmalloc() followed by memcpy() with kmemdup() which combines
> both operations into a single call, making the code cleaner and more
> readable. The zeroing done by kzalloc() is unnecessary here as the
> entire buffer is immediately overwritten by memcpy().
>
> Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
> ---
> Verified with checkpatch.pl - no errors or warnings.
> Compiled the rtl8723bs module successfully.
> Tested by loading the module in a QEMU environment - module loads
> successfully with no errors.
Loading a module doesn't do anything (you can do that on a raspberrypi),
you have to have the hardware to bind to the driver and actually call
the ioctl to verify it works. So while loading is nice, you didn't
actually exercise your change at all :(
Not to say this change is not correct, just be a bit more careful as to
how you attempt to test this please.
thanks,
greg k-h
next prev parent reply other threads:[~2026-03-14 10:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260314-rtl8723bs-kmemdup-v1-1-8280a436f20c.ref@yahoo.pl>
2026-03-14 9:11 ` [PATCH] staging: rtl8723bs: replace kmalloc + memcpy with kmemdup in ioctl_cfg80211.c Tomasz Unger
2026-03-14 10:00 ` Greg Kroah-Hartman [this message]
2026-03-14 21:09 ` Ethan Tidmore
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=2026031426-datebook-evolve-ed6b@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=tomasz.unger@yahoo.pl \
/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