[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4D73BA3A.3070700@lwfinger.net>
Date: Sun, 06 Mar 2011 10:45:46 -0600
From: Larry Finger <Larry.Finger@...inger.net>
To: Xiaochen Wang <wangxiaochen0@...il.com>
CC: greg@...ah.com, florian.c.schilhabel@...glemail.com,
lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] check copy_from_user return value in rtl8712
On 03/06/2011 08:24 AM, Xiaochen Wang wrote:
> Description:return -EFAULT if copy_to_user() fails
>
> Signed-off-by: Xiaochen Wang<wangxiaochen0@...il.com>
> ---
> 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 685a7b1..8a8e682 100644
> --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
> +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
> @@ -1965,9 +1965,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)
ACK.
Larry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists