Skip to content

Commit

Permalink
staging: rtl8712: avoid a useless call to memset().
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Dan Carpenter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Steap authored and gregkh committed Jan 7, 2013
1 parent ac6a98d commit 2df29e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/staging/rtl8712/rtl871x_ioctl_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2df29e7

Please sign in to comment.