diff options
author | Malcolm Priestley <tvboxspy@gmail.com> | 2014-01-13 11:23:30 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-13 18:46:19 -0500 |
commit | 9010a286d9857fccfac69e5e8bdf9b74ea1f7c0e (patch) | |
tree | cabc0dfdf88d681f03952ad30b6b5e462fbe34f0 | |
parent | 86a362f16079d435a08d27f92ac2bee4e12856f1 (diff) |
staging: vt6656: sparse fixes: iwctl_siwgenie use memcpy.
extra is in kernel space replace copy_from_user with
memcpy with no need to error check.
We already know that extra is valid by error checking
on wrq->length.
sparse warning
iwctl.c:1567:53: warning: incorrect type in argument 2 (different address spaces)
iwctl.c:1567:53: expected void const [noderef] <asn:1>*from
iwctl.c:1567:53: got char *extra
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/vt6656/iwctl.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwctl.c index 058df6516784..bf5687708e18 100644 --- a/drivers/staging/vt6656/iwctl.c +++ b/drivers/staging/vt6656/iwctl.c | |||
@@ -1564,10 +1564,8 @@ int iwctl_siwgenie(struct net_device *dev, struct iw_request_info *info, | |||
1564 | goto out; | 1564 | goto out; |
1565 | } | 1565 | } |
1566 | memset(pMgmt->abyWPAIE, 0, MAX_WPA_IE_LEN); | 1566 | memset(pMgmt->abyWPAIE, 0, MAX_WPA_IE_LEN); |
1567 | if (copy_from_user(pMgmt->abyWPAIE, extra, wrq->length)) { | 1567 | |
1568 | ret = -EFAULT; | 1568 | memcpy(pMgmt->abyWPAIE, extra, wrq->length); |
1569 | goto out; | ||
1570 | } | ||
1571 | pMgmt->wWPAIELen = wrq->length; | 1569 | pMgmt->wWPAIELen = wrq->length; |
1572 | } else { | 1570 | } else { |
1573 | memset(pMgmt->abyWPAIE, 0, MAX_WPA_IE_LEN); | 1571 | memset(pMgmt->abyWPAIE, 0, MAX_WPA_IE_LEN); |