Commit c29bbca2 authored by Saurav Girepunje's avatar Saurav Girepunje Committed by Greg Kroah-Hartman
Browse files

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



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

Acked-by: default avatarPhillip Potter <phil@philpotter.co.uk>
Signed-off-by: default avatarSaurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YTJhwQstKPUYRwN+@user


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b53cf65e
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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;