aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Snitselaar <dev@snitselaar.org>2014-04-30 23:58:55 -0700
committerRiley Andrews <riandrews@google.com>2015-01-13 22:40:24 +0000
commit12b727a8f9ba257c8d5882a65661e5a81521e571 (patch)
treef24f7fe0a8d2c2189bb743992c3c85172bcadbff
parentd0a7d1865c7ff9054a8eeb722e4f7ae0d80fcdb3 (diff)
downloadlinux-linaro-stable-12b727a8f9ba257c8d5882a65661e5a81521e571.tar.gz
staging: binder: cleanup dereference of noderef expressions
Clean up sparse warnings for cred struct dereference. Change-Id: I78059976c0488abfe9eb4e9f0b0f8ac10c7ef4f9 Signed-off-by: Jerry Snitselaar <dev@snitselaar.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/android/binder.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index 35c00abc3dd1..c78411a22562 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -1326,6 +1326,7 @@ static void binder_transaction(struct binder_proc *proc,
struct binder_transaction *in_reply_to = NULL;
struct binder_transaction_log_entry *e;
uint32_t return_error;
+ const struct cred *cred = __task_cred(proc->tsk);
e = binder_transaction_log_add(&binder_transaction_log);
e->call_type = reply ? 2 : !!(tr->flags & TF_ONE_WAY);
@@ -1467,7 +1468,7 @@ static void binder_transaction(struct binder_proc *proc,
t->from = thread;
else
t->from = NULL;
- t->sender_euid = proc->tsk->cred->euid;
+ t->sender_euid = cred->euid;
t->to_proc = target_proc;
t->to_thread = target_thread;
t->code = tr->code;
@@ -2600,6 +2601,7 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
struct binder_thread *thread;
unsigned int size = _IOC_SIZE(cmd);
void __user *ubuf = (void __user *)arg;
+ const struct cred *cred = current_cred();
/*pr_info("binder_ioctl: %d:%d %x %lx\n", proc->pid, current->pid, cmd, arg);*/
@@ -2685,15 +2687,15 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
goto err;
}
if (uid_valid(binder_context_mgr_uid)) {
- if (!uid_eq(binder_context_mgr_uid, current->cred->euid)) {
+ if (!uid_eq(binder_context_mgr_uid, cred->euid)) {
pr_err("BINDER_SET_CONTEXT_MGR bad uid %d != %d\n",
- from_kuid(&init_user_ns, current->cred->euid),
+ from_kuid(&init_user_ns, cred->euid),
from_kuid(&init_user_ns, binder_context_mgr_uid));
ret = -EPERM;
goto err;
}
} else
- binder_context_mgr_uid = current->cred->euid;
+ binder_context_mgr_uid = cred->euid;
binder_context_mgr_node = binder_new_node(proc, 0, 0);
if (binder_context_mgr_node == NULL) {
ret = -ENOMEM;