diff options
author | Tapasweni Pathak <tapaswenipathak@gmail.com> | 2014-10-21 09:48:20 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-10-23 12:20:44 +0800 |
commit | 705515cdcdf972ad9df4d1a9874d0e94a3cad517 (patch) | |
tree | d3173a73dae874e10cb5ce66111946c6a7f809d1 /drivers/staging/rtl8188eu | |
parent | b312fb06b50b2aed3e75527fa74bc475dfb57cd6 (diff) |
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 <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu')
-rw-r--r-- | drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 4 |
1 files changed, 1 insertions, 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; |