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>
This commit is contained in:
Xiaochen Wang 2011-03-06 22:24:14 +08:00 committed by Greg Kroah-Hartman
parent 9603ff50b5
commit cd92274093

View file

@ -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)