diff options
author | Cyril Roelandt <tipecaml@gmail.com> | 2012-12-11 01:20:48 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-07 14:53:58 -0800 |
commit | 2df29e7bf2e99bfb085370753291083ae745b057 (patch) | |
tree | b48a7ed5e822776d25a80267cd6d0d0fa8994e21 | |
parent | ac6a98d452baa4f9acae7c2238f6626bae8283ff (diff) |
staging: rtl8712: avoid a useless call to memset().
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@gmail.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c index 3a6479064519..72c51b31830a 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c @@ -1131,11 +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)) { + 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; } |