Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Malcolm Priestley and committed by
Greg Kroah-Hartman
9010a286 86a362f1

+2 -4
+2 -4
drivers/staging/vt6656/iwctl.c
··· 1564 1564 goto out; 1565 1565 } 1566 1566 memset(pMgmt->abyWPAIE, 0, MAX_WPA_IE_LEN); 1567 - if (copy_from_user(pMgmt->abyWPAIE, extra, wrq->length)) { 1568 - ret = -EFAULT; 1569 - goto out; 1570 - } 1567 + 1568 + memcpy(pMgmt->abyWPAIE, extra, wrq->length); 1571 1569 pMgmt->wWPAIELen = wrq->length; 1572 1570 } else { 1573 1571 memset(pMgmt->abyWPAIE, 0, MAX_WPA_IE_LEN);