tipc: fix sleeping in tipc accept routine
authorHoang Le <hoang.h.le@dektech.com.au>
Fri, 23 Jul 2021 02:25:34 +0000 (09:25 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Aug 2021 10:46:42 +0000 (12:46 +0200)
commita41282e82a1d13ad2cca0f07879d7042780d8e78
treec9608c78841321f3e5409df06a70209d58b8cbca
parent10f585740cf0bf5b037a70a4d4eb3096fd713490
tipc: fix sleeping in tipc accept routine

[ Upstream commit d237a7f11719ff9320721be5818352e48071aab6 ]

The release_sock() is blocking function, it would change the state
after sleeping. In order to evaluate the stated condition outside
the socket lock context, switch to use wait_woken() instead.

Fixes: 6398e23cdb1d8 ("tipc: standardize accept routine")
Acked-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/tipc/socket.c