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

staging: vt6656: sparse fixes: iwctl_giwgenie use memcpy.

extra is in kernel space use memcpy.

sparse warning
iwctl.c:1595:42: warning: incorrect type in argument 1 (different address spaces)
iwctl.c:1595:42: expected void [noderef] <asn:1>*to
iwctl.c:1595:42: 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
c1cd1497 9010a286

+4 -6
+4 -6
drivers/staging/vt6656/iwctl.c
··· 1591 1591 wrq->length = 0; 1592 1592 if (pMgmt->wWPAIELen > 0) { 1593 1593 wrq->length = pMgmt->wWPAIELen; 1594 - if (pMgmt->wWPAIELen <= space) { 1595 - if (copy_to_user(extra, pMgmt->abyWPAIE, pMgmt->wWPAIELen)) { 1596 - ret = -EFAULT; 1597 - } 1598 - } else { 1594 + 1595 + if (pMgmt->wWPAIELen <= space) 1596 + memcpy(extra, pMgmt->abyWPAIE, pMgmt->wWPAIELen); 1597 + else 1599 1598 ret = -E2BIG; 1600 - } 1601 1599 } 1602 1600 return ret; 1603 1601 }