From: Larry Finger <Larry.Finger@lwfinger.net>
To: Xiaochen Wang <wangxiaochen0@gmail.com>
Cc: greg@kroah.com, florian.c.schilhabel@googlemail.com,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] check copy_from_user return value in rtl8712
Date: Sun, 06 Mar 2011 10:45:46 -0600 [thread overview]
Message-ID: <4D73BA3A.3070700@lwfinger.net> (raw)
In-Reply-To: <20110306142414.GA19990@chii>
On 03/06/2011 08:24 AM, Xiaochen Wang wrote:
> Description:return -EFAULT if copy_to_user() fails
>
> Signed-off-by: Xiaochen Wang<wangxiaochen0@gmail.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
parent reply other threads:[~2011-03-06 16:45 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20110306142414.GA19990@chii>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D73BA3A.3070700@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=florian.c.schilhabel@googlemail.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=wangxiaochen0@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.