Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9010a286 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman
Browse files

staging: vt6656: sparse fixes: iwctl_siwgenie use memcpy.



extra is in kernel space replace copy_from_user with
memcpy with no need to error check.

We already know that extra is valid by error checking
on wrq->length.

sparse warning
iwctl.c:1567:53: warning: incorrect type in argument 2 (different address spaces)
iwctl.c:1567:53:    expected void const [noderef] <asn:1>*from
iwctl.c:1567:53:    got char *extra

Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 86a362f1
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -1564,10 +1564,8 @@ int iwctl_siwgenie(struct net_device *dev, struct iw_request_info *info,
			goto out;
			goto out;
		}
		}
		memset(pMgmt->abyWPAIE, 0, MAX_WPA_IE_LEN);
		memset(pMgmt->abyWPAIE, 0, MAX_WPA_IE_LEN);
		if (copy_from_user(pMgmt->abyWPAIE, extra, wrq->length)) {

			ret = -EFAULT;
		memcpy(pMgmt->abyWPAIE, extra, wrq->length);
			goto out;
		}
		pMgmt->wWPAIELen = wrq->length;
		pMgmt->wWPAIELen = wrq->length;
	} else {
	} else {
		memset(pMgmt->abyWPAIE, 0, MAX_WPA_IE_LEN);
		memset(pMgmt->abyWPAIE, 0, MAX_WPA_IE_LEN);