lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aYMce65kLITLyoq5@smile.fi.intel.com>
Date: Wed, 4 Feb 2026 12:16:27 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Minu Jin <s9430939@...er.com>
Cc: gregkh@...uxfoundation.org, andy@...nel.org, dan.carpenter@...aro.org,
	trohan2000@...il.com, straube.linux@...il.com,
	linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 1/5] staging: rtl8723bs: introduce kmemdup() where
 applicable

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



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ