• Vineet Gupta's avatar
    ARC: make futex_atomic_cmpxchg_inatomic() return bimodal · 882a95ae
    Vineet Gupta authored
    Callers of cmpxchg_futex_value_locked() in futex code expect bimodal
    return value:
      !0 (essentially -EFAULT as failure)
       0 (success)
    
    Before this patch, the success return value was old value of futex,
    which could very well be non zero, causing caller to possibly take the
    failure path erroneously.
    
    Fix that by returning 0 for success
    
    (This fix was done back in 2011 for all upstream arches, which ARC
    obviously missed)
    
    Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Michel Lespinasse <walken@google.com>
    Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
    882a95ae
futex.h 4.04 KB