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

Commit d9973179 authored by Hendrik Brueckner's avatar Hendrik Brueckner Committed by David S. Miller
Browse files

af_iucv: fix race in __iucv_sock_wait()



Moving prepare_to_wait before the condition to avoid a race between
schedule_timeout and wake up.
The race can appear during iucv_sock_connect() and iucv_callback_connack().

Signed-off-by: default avatarHendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: default avatarUrsula Braun <ursula.braun@de.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b29e4da4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -59,8 +59,8 @@ do { \
	DEFINE_WAIT(__wait);						\
	long __timeo = timeo;						\
	ret = 0;							\
	while (!(condition)) {						\
	prepare_to_wait(sk->sk_sleep, &__wait, TASK_INTERRUPTIBLE);	\
	while (!(condition)) {						\
		if (!__timeo) {						\
			ret = -EAGAIN;					\
			break;						\