Skip to content

Commit

Permalink
futex: cleanup error exit
Browse files Browse the repository at this point in the history
Reuse the put_key_ref(key2) call in the exit path.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Thomas Gleixner committed May 20, 2009
1 parent 521c180 commit c8b15a7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -2185,10 +2185,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, int fshared,

/* Prepare to wait on uaddr. */
ret = futex_wait_setup(uaddr, val, fshared, &q, &hb);
if (ret) {
put_futex_key(fshared, &key2);
goto out;
}
if (ret)
goto out_key2;

/* Queue the futex_q, drop the hb lock, wait for wakeup. */
futex_wait_queue_me(hb, &q, to);
Expand Down Expand Up @@ -2282,6 +2280,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, int fshared,

out_put_keys:
put_futex_key(fshared, &q.key);
out_key2:
put_futex_key(fshared, &key2);

out:
Expand Down

0 comments on commit c8b15a7

Please sign in to comment.