From: Thomas Gleixner Date: Wed, 20 May 2009 07:18:50 +0000 (+0200) Subject: futex: cleanup error exit X-Git-Tag: v2.6.31-rc1~409^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c8b15a706d921baed3195407e4f55270112bb3c6;p=karo-tx-linux.git futex: cleanup error exit Reuse the put_key_ref(key2) call in the exit path. Signed-off-by: Thomas Gleixner --- diff --git a/kernel/futex.c b/kernel/futex.c index 476603afd147..381125a9f1e0 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -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); @@ -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: