diff options
author | Xiaochen Wang <wangxiaochen0@gmail.com> | 2011-03-06 22:24:14 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-07 13:46:38 -0800 |
commit | cd92274093876c57fa4de0f219a552911ef9adc6 (patch) | |
tree | 5d34e59fbe5112dfe2a0107c77b6d7bc996c6ccb /drivers/staging/rtl8712 | |
parent | 9603ff50b5d56e6ee64b10116ff640320732f9c8 (diff) | |
download | linux-3.10-cd92274093876c57fa4de0f219a552911ef9adc6.tar.gz linux-3.10-cd92274093876c57fa4de0f219a552911ef9adc6.tar.bz2 linux-3.10-cd92274093876c57fa4de0f219a552911ef9adc6.zip |
staging: rtl8712: check copy_from_user return value
Description:return -EFAULT if copy_to_user() fails
Signed-off-by: Xiaochen Wang <wangxiaochen0@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rtl8712')
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c index 221be81c85e..4ac17c0bbd5 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c @@ -1970,9 +1970,9 @@ static int r871x_wps_start(struct net_device *dev, struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; u32 u32wps_start = 0; - unsigned int uintRet = 0; - uintRet = copy_from_user((void *)&u32wps_start, pdata->pointer, 4); + if (copy_from_user((void *)&u32wps_start, pdata->pointer, 4)) + return -EFAULT; if ((padapter->bDriverStopped) || (pdata == NULL)) return -EINVAL; if (u32wps_start == 0) |