[PATCH] staging: vt6655: wpactl.c: Fix sparse warnings
From: Martin Berglund
Date: Thu Aug 07 2014 - 18:18:17 EST
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@xxxxxxxxxx>
---
This was submitted as part of Eudyptula challenge task 16
drivers/staging/vt6655/wpactl.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c
index 5f454ca..d75dd79 100644
--- a/drivers/staging/vt6655/wpactl.c
+++ b/drivers/staging/vt6655/wpactl.c
@@ -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;
}
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/