public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: vt6655: wpactl.c: Fix sparse warnings
@ 2014-08-07 22:08 Martin Berglund
  2014-08-08  2:18 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Berglund @ 2014-08-07 22:08 UTC (permalink / raw)
  To: Forest Bond, Greg Kroah-Hartman, Guido Martínez, devel,
	linux-kernel

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>
---
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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-08-10 13:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-07 22:08 [PATCH] staging: vt6655: wpactl.c: Fix sparse warnings Martin Berglund
2014-08-08  2:18 ` Greg Kroah-Hartman
2014-08-08  7:07   ` Martin Berglund
2014-08-08 13:47     ` Greg Kroah-Hartman
2014-08-08 23:55       ` Martin Berglund
2014-08-10  3:36         ` Greg Kroah-Hartman
2014-08-10 13:28           ` Martin Berglund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox