staging: r8188eu: os_dep: use kmemdup instead of kzalloc and memcpy
PATCH 1/1 staging: r8188eu: os_dep: use kmemdup instead of kzalloc and memcpy
Fixes coccicheck warning:WARNING opportunity for kmemdup in ioctl_linux.c
Signed-off-by Saurav Girepunje <[email protected]>
--- drivers/staging/r8188eu/os_dep/ioctl_linux.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/r8188eu/os_dep/ioctl_linux.c +1 -3
@@ -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;
--
2.32.0
Quoted 29 lines · Saurav Girepunje
Fixes coccicheck warning:WARNING opportunity for kmemdup in
ioctl_linux.cSigned-off-by Saurav Girepunje <[email protected]>--- drivers/staging/r8188eu/os_dep/ioctl_linux.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/staging/r8188eu/os_dep/ioctl_linux.c +1
-4@@ -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; --
Quoted 2 lines
2.32.0
Dear Saurav,
Looks good, thanks:
Acked-by Phillip Potter <[email protected]>
Regards,
Phil
Quoted 36 lines · Phillip Potter
Quoted 29 lines · Saurav Girepunje
Fixes coccicheck warning:WARNING opportunity for kmemdup in
ioctl_linux.cSigned-off-by Saurav Girepunje <[email protected]>--- drivers/staging/r8188eu/os_dep/ioctl_linux.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/staging/r8188eu/os_dep/ioctl_linux.c +1
-4@@ -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; --Quoted 2 lines
2.32.0
Dear Saurav,
Quoted 6 lines
Looks good, thanks:
Acked-by Phillip Potter <[email protected]>Regards,
Phil
Thanks for review Phil
Regards,
Saurav Girepunje