]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Futex-fd error return fix
authorRusty Russell <rusty@rustcorp.com.au>
Sat, 6 Sep 2003 07:22:21 +0000 (00:22 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sat, 6 Sep 2003 07:22:21 +0000 (00:22 -0700)
Hugh Dickins caught this confusion between the ret variable in outer
scope (holding the fd) and the return value of f_setown.  Rename inner
"ret".

kernel/futex.c

index 695e20eb222f789620adec0de832b6d252ceba26..6691f6475869f89dd38955ad56563a48db6d2cd7 100644 (file)
@@ -478,12 +478,12 @@ static int futex_fd(unsigned long uaddr, int signal)
        filp->f_dentry = dget(futex_mnt->mnt_root);
 
        if (signal) {
-               int ret;
-               
-               ret = f_setown(filp, current->tgid, 1);
-               if (ret) {
+               int err;
+               err = f_setown(filp, current->tgid, 1);
+               if (err < 0) {
                        put_unused_fd(ret);
                        put_filp(filp);
+                       ret = err;
                        goto out;
                }
                filp->f_owner.signum = signal;