mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
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:
committed by
Greg Kroah-Hartman
parent
b53cf65e12
commit
c29bbca243
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user