Skip to content

Commit

Permalink
Merge branch 'vsock-remove-an-unused-variable-and-fix-infinite-sleep'
Browse files Browse the repository at this point in the history
Dexuan Cui says:

====================
vsock: remove an unused variable and fix infinite sleep

Patch 1 removes the unused 'wait' variable.
Patch 2 fixes an infinite sleep issue reported by a hv_sock user.
====================

Link: https://lore.kernel.org/r/20221101021706.26152-1-decui@microsoft.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Paolo Abeni committed Nov 3, 2022
2 parents 768b3c7 + 466a853 commit 715aee0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions net/vmw_vsock/af_vsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1905,8 +1905,11 @@ static int vsock_connectible_wait_data(struct sock *sk,
err = 0;
transport = vsk->transport;

while ((data = vsock_connectible_has_data(vsk)) == 0) {
while (1) {
prepare_to_wait(sk_sleep(sk), wait, TASK_INTERRUPTIBLE);
data = vsock_connectible_has_data(vsk);
if (data != 0)
break;

if (sk->sk_err != 0 ||
(sk->sk_shutdown & RCV_SHUTDOWN) ||
Expand Down Expand Up @@ -2092,8 +2095,6 @@ vsock_connectible_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
const struct vsock_transport *transport;
int err;

DEFINE_WAIT(wait);

sk = sock->sk;
vsk = vsock_sk(sk);
err = 0;
Expand Down

0 comments on commit 715aee0

Please sign in to comment.