All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: gdm72xx: Fix sparse warning
@ 2015-10-29  2:41 Ksenija Stanojevic
  2015-11-04 19:06 ` [Outreachy kernel] " Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Ksenija Stanojevic @ 2015-10-29  2:41 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Ksenija Stanojevic

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))
 			return -EFAULT;
 	}
 	return 0;
@@ -401,7 +401,7 @@ static int gdm_wimax_ioctl_set_data(struct data_s *dst, struct data_s *src)
 			return -ENOMEM;
 	}
 
-	if (copy_from_user(dst->buf, src->buf, src->size)) {
+	if (copy_from_user(dst->buf, (void __user *)src->buf, src->size)) {
 		kdelete(&dst->buf);
 		return -EFAULT;
 	}
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-04 19:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-29  2:41 [PATCH] Staging: gdm72xx: Fix sparse warning Ksenija Stanojevic
2015-11-04 19:06 ` [Outreachy kernel] " Greg KH
2015-11-04 19:14   ` Ksenija Stanojević
2015-11-04 19:21     ` Arnd Bergmann

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.