public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/6] staging: vt6656: sparse fixes: iwctl_giwgenie use memcpy.
@ 2014-01-13 16:25 Malcolm Priestley
  0 siblings, 0 replies; only message in thread
From: Malcolm Priestley @ 2014-01-13 16:25 UTC (permalink / raw)
  To: gregkh; +Cc: linux-wireless

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>
---
 drivers/staging/vt6656/iwctl.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwctl.c
index bf56877..3a68dfa 100644
--- a/drivers/staging/vt6656/iwctl.c
+++ b/drivers/staging/vt6656/iwctl.c
@@ -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;
 }
-- 
1.8.5.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-01-13 16:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-13 16:25 [PATCH 5/6] staging: vt6656: sparse fixes: iwctl_giwgenie use memcpy Malcolm Priestley

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