All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Berglund <martin@rogsta.net>
To: "Forest Bond" <forest@alittletooquiet.net>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Guido Martínez" <guido@vanguardiasur.com.ar>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] staging: vt6655: wpactl.c: Fix sparse warnings
Date: Thu, 7 Aug 2014 23:08:34 +0100	[thread overview]
Message-ID: <20140807220834.GA21645@licorice> (raw)

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


             reply	other threads:[~2014-08-07 22:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-07 22:08 Martin Berglund [this message]
2014-08-08  2:18 ` [PATCH] staging: vt6655: wpactl.c: Fix sparse warnings 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140807220834.GA21645@licorice \
    --to=martin@rogsta.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=forest@alittletooquiet.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=guido@vanguardiasur.com.ar \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.