public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: replace kzalloc/memcpy with kmemdup
@ 2026-03-08 11:25 starPt
  2026-03-08 22:54 ` Ethan Tidmore
  0 siblings, 1 reply; 2+ messages in thread
From: starPt @ 2026-03-08 11:25 UTC (permalink / raw)
  To: gregkh; +Cc: straube.linux, linux-staging, linux-kernel, starpt.official

Replace the open-coded kzalloc and memcpy combination with kmemdup()
to make the code more concise and idiomatic.

Signed-off-by: starPt <starpt.official@gmail.com>
---
 drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 7cb0c6f22bf3..2125606f7775 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -1430,14 +1430,12 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
 		goto exit;
 	}
 
-	buf = kzalloc(ielen, GFP_KERNEL);
+	buf = kmemdup(pie, ielen, GFP_KERNEL);
 	if (!buf) {
 		ret =  -ENOMEM;
 		goto exit;
 	}
 
-	memcpy(buf, pie, ielen);
-
 	if (ielen < RSN_HEADER_LEN) {
 		ret  = -1;
 		goto exit;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: rtl8723bs: replace kzalloc/memcpy with kmemdup
  2026-03-08 11:25 [PATCH] staging: rtl8723bs: replace kzalloc/memcpy with kmemdup starPt
@ 2026-03-08 22:54 ` Ethan Tidmore
  0 siblings, 0 replies; 2+ messages in thread
From: Ethan Tidmore @ 2026-03-08 22:54 UTC (permalink / raw)
  To: starPt, gregkh; +Cc: straube.linux, linux-staging, linux-kernel

On Sun Mar 8, 2026 at 6:25 AM CDT, starPt wrote:
> Replace the open-coded kzalloc and memcpy combination with kmemdup()
> to make the code more concise and idiomatic.
>
> Signed-off-by: starPt <starpt.official@gmail.com>

You must use your real name.

Thanks,

ET

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-08 22:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-08 11:25 [PATCH] staging: rtl8723bs: replace kzalloc/memcpy with kmemdup starPt
2026-03-08 22:54 ` Ethan Tidmore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox