From: Greg KH <gregkh@linuxfoundation.org>
To: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] Staging: gdm72xx: Fix sparse warning
Date: Wed, 4 Nov 2015 11:06:37 -0800 [thread overview]
Message-ID: <20151104190637.GA6140@kroah.com> (raw)
In-Reply-To: <1446086478-14386-1-git-send-email-ksenija.stanojevic@gmail.com>
On Wed, Oct 28, 2015 at 07:41:18PM -0700, Ksenija Stanojevic wrote:
> Calls copy_{to,from}_user() do not use '__user' annotation
> while refrencing user space pointers.
>
> Fix following sparse warnings by passing missing __user annotation:
>
> drivers/staging/gdm72xx/gdm_wimax.c:381:37: warning: incorrect type in
> argument 1 (different address spaces)
> drivers/staging/gdm72xx/gdm_wimax.c:381:37: expected void [noderef]
> <asn:1>*to
> drivers/staging/gdm72xx/gdm_wimax.c:381:37: got void *buf
> drivers/staging/gdm72xx/gdm_wimax.c:404:41: warning: incorrect type in
> argument 2 (different address spaces)
> drivers/staging/gdm72xx/gdm_wimax.c:404:41: expected void const
> [noderef] <asn:1>*from
> drivers/staging/gdm72xx/gdm_wimax.c:404:41: got void *buf
>
> Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
> ---
> drivers/staging/gdm72xx/gdm_wimax.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c
> index d9ddced..a5b4b72 100644
> --- a/drivers/staging/gdm72xx/gdm_wimax.c
> +++ b/drivers/staging/gdm72xx/gdm_wimax.c
> @@ -378,7 +378,7 @@ static int gdm_wimax_ioctl_get_data(struct data_s *dst, struct data_s *src)
> if (src->size) {
> if (!dst->buf)
> return -EINVAL;
> - if (copy_to_user(dst->buf, src->buf, size))
> + if (copy_to_user((void __user *)dst->buf, src->buf, size))
Shouldn't the variable be described as a __user pointer instead? Don't
cast away warnings, fix the root problem.
thanks,
greg k-h
next prev parent reply other threads:[~2015-11-04 19:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-29 2:41 [PATCH] Staging: gdm72xx: Fix sparse warning Ksenija Stanojevic
2015-11-04 19:06 ` Greg KH [this message]
2015-11-04 19:14 ` [Outreachy kernel] " Ksenija Stanojević
2015-11-04 19:21 ` Arnd Bergmann
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=20151104190637.GA6140@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=ksenija.stanojevic@gmail.com \
--cc=outreachy-kernel@googlegroups.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.