Skip to content

Commit

Permalink
staging: vt6656: sparse fixes: iwctl_giwgenie use memcpy.
Browse files Browse the repository at this point in the history
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>
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 9010a28 commit c1cd149
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/staging/vt6656/iwctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c1cd149

Please sign in to comment.