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] [day] [month] [year] [list]
Message-ID: <a497e930-00d5-b830-b29c-531c18da800a@gmail.com>
Date:   Thu, 3 Nov 2022 23:02:19 +0100
From:   Philipp Hortmann <philipp.g.hortmann@...il.com>
To:     Colin Ian King <colin.i.king@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Aaron Lawrence <t4rmin@...omail.com>,
        Yogesh Hegde <yogi.kernel@...il.com>,
        linux-staging@...ts.linux.dev
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] staging: rtl8192e: rtl819x_HTProc: make arrays
 const and one static

On 11/3/22 14:06, Colin Ian King wrote:
> Make two dead-only arrays const. Make array EWC11NHTCap static const
> so it is not populated on the stack, makes the code smaller too.
> 
> Signed-off-by: Colin Ian King <colin.i.king@...il.com>
> ---
>   drivers/staging/rtl8192e/rtl819x_HTProc.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> index 62aa8e893c34..84ec8df047d7 100644
> --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
> +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> @@ -282,7 +282,7 @@ void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap,
>   	memset(posHTCap, 0, *len);
>   
>   	if ((bAssoc) && (pHT->ePeerHTSpecVer == HT_SPEC_VER_EWC)) {
> -		u8	EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33};
> +		static const u8	EWC11NHTCap[] = { 0x00, 0x90, 0x4c, 0x33 };
>   
>   		memcpy(posHTCap, EWC11NHTCap, sizeof(EWC11NHTCap));
>   		pCapELE = (struct ht_capab_ele *)&posHTCap[4];
> @@ -515,8 +515,8 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
>   	u16 nMaxAMSDUSize = 0;
>   	u8 *pMcsFilter = NULL;
>   
> -	static u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33};
> -	static u8 EWC11NHTInfo[] = {0x00, 0x90, 0x4c, 0x34};
> +	static const u8 EWC11NHTCap[] = { 0x00, 0x90, 0x4c, 0x33 };
> +	static const u8 EWC11NHTInfo[] = { 0x00, 0x90, 0x4c, 0x34 };
>   
>   	if (!pHTInfo->bCurrentHTSupport) {
>   		netdev_warn(ieee->dev, "%s(): HT_DISABLE\n", __func__);

Tested-by: Philipp Hortmann <philipp.g.hortmann@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ