diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2005-09-07 00:17:44 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-08 01:57:33 +0200 |
commit | 39ed3fdeec1290dd246dcf1da6b278566987a084 (patch) | |
tree | 46b4f08e2c61eca5871c4805ec4448f1408f2e69 /kernel/futex.c | |
parent | [PATCH] Adapt scripts/ver_linux to new util-linux version strings (diff) | |
download | linux-39ed3fdeec1290dd246dcf1da6b278566987a084.tar.xz linux-39ed3fdeec1290dd246dcf1da6b278566987a084.zip |
[PATCH] futex: remove duplicate code
This patch cleans up the error path of futex_fd() by removing duplicate
code.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/futex.c')
-rw-r--r-- | kernel/futex.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index 07ba87de9658..ca05fe6a70b2 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -786,23 +786,17 @@ static int futex_fd(unsigned long uaddr, int signal) filp->f_mapping = filp->f_dentry->d_inode->i_mapping; if (signal) { - int err; err = f_setown(filp, current->pid, 1); if (err < 0) { - put_unused_fd(ret); - put_filp(filp); - ret = err; - goto out; + goto error; } filp->f_owner.signum = signal; } q = kmalloc(sizeof(*q), GFP_KERNEL); if (!q) { - put_unused_fd(ret); - put_filp(filp); - ret = -ENOMEM; - goto out; + err = -ENOMEM; + goto error; } down_read(¤t->mm->mmap_sem); @@ -810,10 +804,8 @@ static int futex_fd(unsigned long uaddr, int signal) if (unlikely(err != 0)) { up_read(¤t->mm->mmap_sem); - put_unused_fd(ret); - put_filp(filp); kfree(q); - return err; + goto error; } /* @@ -829,6 +821,11 @@ static int futex_fd(unsigned long uaddr, int signal) fd_install(ret, filp); out: return ret; +error: + put_unused_fd(ret); + put_filp(filp); + ret = err; + goto out; } long do_futex(unsigned long uaddr, int op, int val, unsigned long timeout, |