staging: vt6656: sparse fixes: iwctl_giwgenie use memcpy.
authorMalcolm Priestley <tvboxspy@gmail.com>
Mon, 13 Jan 2014 16:25:51 +0000 (16:25 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Jan 2014 23:46:19 +0000 (15:46 -0800)
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>
drivers/staging/vt6656/iwctl.c

index bf5687708e18e1ca05155c20ae09d1a5cd8ae435..3a68dfa23d84a684fe039e63712fffdea6b8e51a 100644 (file)
@@ -1591,13 +1591,11 @@ int iwctl_giwgenie(struct net_device *dev, struct iw_request_info *info,
        wrq->length = 0;
        if (pMgmt->wWPAIELen > 0) {
                wrq->length = pMgmt->wWPAIELen;
-               if (pMgmt->wWPAIELen <= space) {
-                       if (copy_to_user(extra, pMgmt->abyWPAIE, pMgmt->wWPAIELen)) {
-                               ret = -EFAULT;
-                       }
-               } else {
+
+               if (pMgmt->wWPAIELen <= space)
+                       memcpy(extra, pMgmt->abyWPAIE, pMgmt->wWPAIELen);
+               else
                        ret = -E2BIG;
-               }
        }
        return ret;
 }
This page took 0.038859 seconds and 5 git commands to generate.