Commit cd922740 authored by Xiaochen Wang's avatar Xiaochen Wang Committed by Greg Kroah-Hartman

staging: rtl8712: check copy_from_user return value

Description:return -EFAULT if copy_to_user() fails
Signed-off-by: default avatarXiaochen Wang <wangxiaochen0@gmail.com>
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9603ff50
...@@ -1970,9 +1970,9 @@ static int r871x_wps_start(struct net_device *dev, ...@@ -1970,9 +1970,9 @@ static int r871x_wps_start(struct net_device *dev,
struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev);
struct iw_point *pdata = &wrqu->data; struct iw_point *pdata = &wrqu->data;
u32 u32wps_start = 0; 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)) if ((padapter->bDriverStopped) || (pdata == NULL))
return -EINVAL; return -EINVAL;
if (u32wps_start == 0) if (u32wps_start == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment