Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d725fdc8 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by David S. Miller
Browse files

[DCCP]: fix theoretical ccids_{read,write}_lock() race



Make sure that spin_unlock_wait() is properly ordered wrt atomic_inc().

(akpm: can't we convert this code to use rwlocks?)

Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b5890d8b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ static inline void ccids_write_unlock(void)
static inline void ccids_read_lock(void)
{
	atomic_inc(&ccids_lockct);
	smp_mb__after_atomic_inc();
	spin_unlock_wait(&ccids_lock);
}