]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: vt6655: wpactl.c: Fix sparse warnings
authorMartin Berglund <martin@rogsta.net>
Thu, 7 Aug 2014 22:08:34 +0000 (23:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 16 Aug 2014 19:23:15 +0000 (12:23 -0700)
Add missing __user macro casting in the function wpa_set_keys.
This is okay since the function handles the possibility of
param->u.wpa_key.key and param->u.wpa_key.seq pointing to
kernelspace using a flag, fcpfkernel.

Signed-off-by: Martin Berglund <martin@rogsta.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/wpactl.c

index 5f454ca2a3bcbe5f15c47dee87aa5c05384dd87c..d75dd797bd9e28ee051a5821a9fe915082d66634 100644 (file)
@@ -224,7 +224,9 @@ int wpa_set_keys(PSDevice pDevice, void *ctx,
        } else {
                spin_unlock_irq(&pDevice->lock);
                if (param->u.wpa_key.key &&
-                   copy_from_user(&abyKey[0], param->u.wpa_key.key, param->u.wpa_key.key_len)) {
+                   copy_from_user(&abyKey[0],
+                                  (void __user *)param->u.wpa_key.key,
+                                  param->u.wpa_key.key_len)) {
                        spin_lock_irq(&pDevice->lock);
                        return -EINVAL;
                }
@@ -262,7 +264,9 @@ int wpa_set_keys(PSDevice pDevice, void *ctx,
        } else {
                spin_unlock_irq(&pDevice->lock);
                if (param->u.wpa_key.seq &&
-                   copy_from_user(&abySeq[0], param->u.wpa_key.seq, param->u.wpa_key.seq_len)) {
+                   copy_from_user(&abySeq[0],
+                                  (void __user *)param->u.wpa_key.seq,
+                                  param->u.wpa_key.seq_len)) {
                        spin_lock_irq(&pDevice->lock);
                        return -EINVAL;
                }