From 705515cdcdf972ad9df4d1a9874d0e94a3cad517 Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Tue, 21 Oct 2014 09:48:20 +0530 Subject: [PATCH] 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index d598fec4abbf..d8605be07a71 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -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; -- 2.11.0