The patch titled

     futex: remove duplicate code

has been added to the -mm tree.  Its filename is

     futex-remove-duplicate-code.patch

Patches currently in -mm which might be from [EMAIL PROTECTED] are

futex-remove-duplicate-code.patch
introduce-and-use-kzalloc.patch
introduce-and-use-kzalloc-make-kcalloc-a-static-inline.patch
ia64-convert-kcalloc-to-kzalloc.patch
ppc64-convert-kcalloc-to-kzalloc.patch
input-convert-kcalloc-to-kzalloc.patch
usb-convert-kcalloc-to-kzalloc.patch
pci-convert-kcalloc-to-kzalloc.patch
drivers-convert-kcalloc-to-kzalloc.patch
fs-convert-kcalloc-to-kzalloc.patch
alsa-convert-kcalloc-to-kzalloc.patch
update-kfree-vfree-and-vunmap-kerneldoc.patch
add-kerneldoc-reference-to-codingstyle.patch
update-fsf-address-in-copying.patch



From: Pekka Enberg <[EMAIL PROTECTED]>

This patch cleans up the error path of futex_fd() by removing duplicate
code.

Signed-off-by: Pekka Enberg <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 kernel/futex.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff -puN kernel/futex.c~futex-remove-duplicate-code kernel/futex.c
--- 25/kernel/futex.c~futex-remove-duplicate-code       Mon Aug 29 14:03:57 2005
+++ 25-akpm/kernel/futex.c      Mon Aug 29 14:03:57 2005
@@ -786,23 +786,17 @@ static int futex_fd(unsigned long uaddr,
        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(&current->mm->mmap_sem);
@@ -810,10 +804,8 @@ static int futex_fd(unsigned long uaddr,
 
        if (unlikely(err != 0)) {
                up_read(&current->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,
        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,
_
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to