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: <50BEC867.7090209@lwfinger.net>
Date:	Tue, 04 Dec 2012 22:07:03 -0600
From:	Larry Finger <Larry.Finger@...inger.net>
To:	Cyril Roelandt <tipecaml@...il.com>
CC:	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
	florian.c.schilhabel@...glemail.com, gregkh@...uxfoundation.org,
	yongjun_wei@...ndmicro.com.cn, jim.cromie@...il.com,
	marcos.souza.org@...il.com, devel@...verdev.osuosl.org
Subject: Re: [PATCH] staging: rtl8712: avoid a useless call to memset().

On 12/04/2012 07:22 PM, Cyril Roelandt wrote:
> In r8711_wx_get_wap(), make sure we do not call memcpy() on a memory area that
> has just been zeroed by a call to memset().
>
> Signed-off-by: Cyril Roelandt <tipecaml@...il.com>
> ---
>   drivers/staging/rtl8712/rtl871x_ioctl_linux.c |    3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)

Acked-by: Larry Finger <Larry.Finger@...inger.net>

Thanks,

Larry

>
> diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
> index 3a64790..2c73319 100644
> --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
> +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
> @@ -1131,10 +1131,11 @@ static int r8711_wx_get_wap(struct net_device *dev,
>   	struct ndis_wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
>
>   	wrqu->ap_addr.sa_family = ARPHRD_ETHER;
> -	memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN);
>   	if (check_fwstate(pmlmepriv, _FW_LINKED |
>   	    WIFI_ADHOC_MASTER_STATE|WIFI_AP_STATE)) {
>   		memcpy(wrqu->ap_addr.sa_data, pcur_bss->MacAddress, ETH_ALEN);
> +	} else {
> +		memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN);
>   	}
>   	return 0;
>   }
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ