atomic: fix atomic_add_unless() fallback's return value
[platform/upstream/libdrm.git] / xf86atomic.h
index efa47a7..c19e493 100644 (file)
@@ -108,7 +108,7 @@ static inline int atomic_add_unless(atomic_t *v, int add, int unless)
        c = atomic_read(v);
        while (c != unless && (old = atomic_cmpxchg(v, c, c + add)) != c)
                c = old;
-       return c == unless;
+       return c != unless;
 }
 
 #endif