From b1ed8a162a3e5b4f31a49215bdbf27756b625117 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Sun, 18 Jan 2009 18:17:20 +0100 Subject: [PATCH] --- yaml --- r: 130457 b: refs/heads/master c: 1176e83aff6f15b6ae4d1b53c16124884ad29363 h: refs/heads/master i: 130455: 180118ccc0c266d57c2cf0bb9a5145ab428853e9 v: v3 --- [refs] | 2 +- trunk/drivers/staging/android/binder.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 109e15bd2052..abd790e4a7c1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 191805ac41a63929003faa33365027d3fb924d71 +refs/heads/master: 1176e83aff6f15b6ae4d1b53c16124884ad29363 diff --git a/trunk/drivers/staging/android/binder.c b/trunk/drivers/staging/android/binder.c index ab014bc96831..758131cad08a 100644 --- a/trunk/drivers/staging/android/binder.c +++ b/trunk/drivers/staging/android/binder.c @@ -319,6 +319,7 @@ int task_get_unused_fd_flags(struct task_struct *tsk, int flags) int fd, error; struct fdtable *fdt; unsigned long rlim_cur; + unsigned long irqs; if (files == NULL) return -ESRCH; @@ -335,12 +336,11 @@ int task_get_unused_fd_flags(struct task_struct *tsk, int flags) * N.B. For clone tasks sharing a files structure, this test * will limit the total number of files that can be opened. */ - rcu_read_lock(); - if (tsk->signal) + rlim_cur = 0; + if (lock_task_sighand(tsk, &irqs)) { rlim_cur = tsk->signal->rlim[RLIMIT_NOFILE].rlim_cur; - else - rlim_cur = 0; - rcu_read_unlock(); + unlock_task_sighand(tsk, &irqs); + } if (fd >= rlim_cur) goto out;