lkml.org 
[lkml]   [2016]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] asm-generic/futex: Properly re-enable preemption in futex_atomic_cmpxchg_inatomic()
On Thu, Apr 14, 2016 at 03:36:03PM +0200, Romain Perier wrote:
> Fixes: d9b9ff8c1889 ("sched/preempt, futex: Disable preemption in UP futex_atomic_cmpxchg_inatomic() explicitly")
> Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
> ---
> include/asm-generic/futex.h | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/include/asm-generic/futex.h b/include/asm-generic/futex.h
> index e56272c..bf2d34c 100644
> --- a/include/asm-generic/futex.h
> +++ b/include/asm-generic/futex.h
> @@ -108,11 +108,15 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
> u32 val;
>
> preempt_disable();
> - if (unlikely(get_user(val, uaddr) != 0))
> + if (unlikely(get_user(val, uaddr) != 0)) {
> + preempt_enable();
> return -EFAULT;
> + }
>
> - if (val == oldval && unlikely(put_user(newval, uaddr) != 0))
> + if (val == oldval && unlikely(put_user(newval, uaddr) != 0)) {
> + preempt_enable();
> return -EFAULT;
> + }
>
> *uval = val;
> preempt_enable();

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

\
 
 \ /
  Last update: 2016-04-14 18:01    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog