diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c index e0505b9b8a31..7b0d64f0d550 100644 --- a/kernel/locking/rwsem.c +++ b/kernel/locking/rwsem.c @@ -1287,7 +1287,7 @@ out_nolock: list_del(&waiter.list); if (unlikely(wstate == WRITER_HANDOFF)) - atomic_long_add(-RWSEM_FLAG_HANDOFF, &sem->count); + atomic_long_andnot(RWSEM_FLAG_HANDOFF, &sem->count); if (list_empty(&sem->wait_list)) atomic_long_andnot(RWSEM_FLAG_WAITERS, &sem->count);