public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND 1/2] staging: binder: add __user annotation in binder.c
@ 2014-04-15 10:03 Mathieu Maret
  2014-04-15 10:03 ` [PATCH RESEND 2/2] staging: binder: Code simplification Mathieu Maret
  2014-04-15 11:54 ` [PATCH RESEND 1/2] staging: binder: add __user annotation in binder.c Dan Carpenter
  0 siblings, 2 replies; 7+ messages in thread
From: Mathieu Maret @ 2014-04-15 10:03 UTC (permalink / raw)
  Cc: linux-kernel, gregkh, arve, joe, serban.constantinescu, prtvar.b,
	devel, standby24x7, Mathieu Maret

Add __user to binder_version to correct sparse warning.
Reduce line size to fit to coding style.

Signed-off-by: Mathieu Maret <mathieu.maret@gmail.com>
---
 drivers/staging/android/binder.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index cfe4bc8..3dca577 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -2683,16 +2683,20 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 		binder_free_thread(proc, thread);
 		thread = NULL;
 		break;
-	case BINDER_VERSION:
+	case BINDER_VERSION:{
+		struct binder_version __user *ver = ubuf;
+
 		if (size != sizeof(struct binder_version)) {
 			ret = -EINVAL;
 			goto err;
 		}
-		if (put_user(BINDER_CURRENT_PROTOCOL_VERSION, &((struct binder_version *)ubuf)->protocol_version)) {
+		if (put_user(BINDER_CURRENT_PROTOCOL_VERSION,
+			     &ver->protocol_version)) {
 			ret = -EINVAL;
 			goto err;
 		}
 		break;
+	}
 	default:
 		ret = -EINVAL;
 		goto err;
-- 
1.8.3.2


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

end of thread, other threads:[~2014-04-17  3:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-15 10:03 [PATCH RESEND 1/2] staging: binder: add __user annotation in binder.c Mathieu Maret
2014-04-15 10:03 ` [PATCH RESEND 2/2] staging: binder: Code simplification Mathieu Maret
2014-04-15 11:56   ` Dan Carpenter
2014-04-17  3:16   ` Greg KH
2014-04-15 11:54 ` [PATCH RESEND 1/2] staging: binder: add __user annotation in binder.c Dan Carpenter
2014-04-15 12:04   ` Mathieu Maret
2014-04-15 12:44     ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox