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

Fixes coccicheck warning:WARNING opportunity for kmemdup in ioctl_linux.c

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YTJhwQstKPUYRwN+@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Saurav Girepunje
2021-09-03 23:26:17 +05:30
committed by Greg Kroah-Hartman
parent b53cf65e12
commit c29bbca243

View File

@@ -585,14 +585,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) {
ret = -ENOMEM;
goto exit;
}
memcpy(buf, pie, ielen);
/* dump */
{
int i;