Skip to content

Commit

Permalink
staging: rtl8712: check copy_from_user return value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xiaochen Wang authored and Greg Kroah-Hartman committed Mar 7, 2011
1 parent 9603ff5 commit cd92274
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/rtl8712/rtl871x_ioctl_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cd92274

Please sign in to comment.