From: Mathieu Maret <mathieu.maret@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
arve@android.com, joe@perches.com, serban.constantinescu@arm.com,
prtvar.b@gmail.com, devel@driverdev.osuosl.org,
standby24x7@gmail.com, Mathieu Maret <mathieu.maret@gmail.com>
Subject: [PATCH RESEND 1/2] staging: binder: add __user annotation in binder.c
Date: Tue, 15 Apr 2014 12:03:05 +0200 [thread overview]
Message-ID: <1397556186-5465-1-git-send-email-mathieu.maret@gmail.com> (raw)
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
next reply other threads:[~2014-04-15 10:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-15 10:03 Mathieu Maret [this message]
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
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=1397556186-5465-1-git-send-email-mathieu.maret@gmail.com \
--to=mathieu.maret@gmail.com \
--cc=arve@android.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=prtvar.b@gmail.com \
--cc=serban.constantinescu@arm.com \
--cc=standby24x7@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®