Commit 705515cd authored by Tapasweni Pathak's avatar Tapasweni Pathak Committed by Greg Kroah-Hartman

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: default avatarTapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b312fb06
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment