1
0
Fork 0

staging: rtl8188eu: os_dep: Replaced kzalloc and memcpy with kmemdup

Replaced calls to kzalloc followed by memcpy with a single call to
kmemdup.

Patch found using coccicheck.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
hifive-unleashed-5.1
Tapasweni Pathak 2014-10-21 09:48:20 +05:30 committed by Greg Kroah-Hartman
parent b312fb06b5
commit 705515cdcd
1 changed files with 1 additions and 3 deletions

View File

@ -512,14 +512,12 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie
}
if (ielen) {
buf = kzalloc(ielen, GFP_KERNEL);
buf = kmemdup(pie, ielen, GFP_KERNEL);
if (buf == NULL) {
ret = -ENOMEM;
goto exit;
}
memcpy(buf, pie, ielen);
/* dump */
{
int i;