Commit c29bbca2 authored by Saurav Girepunje's avatar Saurav Girepunje Committed by Greg Kroah-Hartman

staging: r8188eu: os_dep: use kmemdup instead of kzalloc and memcpy

Fixes coccicheck warning:WARNING opportunity for kmemdup in ioctl_linux.c
Acked-by: default avatarPhillip Potter <phil@philpotter.co.uk>
Signed-off-by: default avatarSaurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YTJhwQstKPUYRwN+@userSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b53cf65e
...@@ -585,14 +585,12 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie ...@@ -585,14 +585,12 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie
} }
if (ielen) { if (ielen) {
buf = kzalloc(ielen, GFP_KERNEL); buf = kmemdup(pie, ielen, GFP_KERNEL);
if (!buf) { if (!buf) {
ret = -ENOMEM; ret = -ENOMEM;
goto exit; goto exit;
} }
memcpy(buf, pie, ielen);
/* dump */ /* dump */
{ {
int i; 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