Skip to content

Commit

Permalink
staging: vt6656: sparse fixes: iwctl_siwgenie use memcpy.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Malcolm Priestley authored and Greg Kroah-Hartman committed Jan 13, 2014
1 parent 86a362f commit 9010a28
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/staging/vt6656/iwctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1564,10 +1564,8 @@ int iwctl_siwgenie(struct net_device *dev, struct iw_request_info *info,
goto out;
}
memset(pMgmt->abyWPAIE, 0, MAX_WPA_IE_LEN);
if (copy_from_user(pMgmt->abyWPAIE, extra, wrq->length)) {
ret = -EFAULT;
goto out;
}

memcpy(pMgmt->abyWPAIE, extra, wrq->length);
pMgmt->wWPAIELen = wrq->length;
} else {
memset(pMgmt->abyWPAIE, 0, MAX_WPA_IE_LEN);
Expand Down

0 comments on commit 9010a28

Please sign in to comment.