Staging: rtl8188eu: replace kzalloc and memcpy by kmemdup

This was generated by 'make coccicheck' using scripts at
scripts/coccinelle/api/memdup.cocci.

Signed-off-by: Niranjan Dighe <niranjan.dighe@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Niranjan Dighe 2015-03-25 00:46:33 +05:30 committed by Greg Kroah-Hartman
parent 90403aa118
commit da3c8deef6
1 changed files with 2 additions and 3 deletions

View File

@ -5431,15 +5431,14 @@ u8 set_tx_beacon_cmd(struct adapter *padapter)
goto exit; goto exit;
} }
ptxBeacon_parm = kzalloc(sizeof(struct wlan_bssid_ex), GFP_KERNEL); ptxBeacon_parm = kmemdup(&(pmlmeinfo->network),
sizeof(struct wlan_bssid_ex), GFP_KERNEL);
if (ptxBeacon_parm == NULL) { if (ptxBeacon_parm == NULL) {
kfree(ph2c); kfree(ph2c);
res = _FAIL; res = _FAIL;
goto exit; goto exit;
} }
memcpy(ptxBeacon_parm, &(pmlmeinfo->network), sizeof(struct wlan_bssid_ex));
len_diff = update_hidden_ssid(ptxBeacon_parm->IEs+_BEACON_IE_OFFSET_, len_diff = update_hidden_ssid(ptxBeacon_parm->IEs+_BEACON_IE_OFFSET_,
ptxBeacon_parm->IELength-_BEACON_IE_OFFSET_, ptxBeacon_parm->IELength-_BEACON_IE_OFFSET_,
pmlmeinfo->hidden_ssid_mode); pmlmeinfo->hidden_ssid_mode);