Skip to content

Commit

Permalink
net/smc: add receive timeout check
Browse files Browse the repository at this point in the history
The SMC receive function currently lacks a timeout check under the
condition that no data were received and no data are available. This
patch adds such a check.

Signed-off-by: Hans Wippel <hwippel@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Hans Wippel authored and David S. Miller committed Sep 21, 2017
1 parent 09579ac commit 846e344
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/smc/smc_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg, size_t len,
read_done = sock_intr_errno(timeo);
break;
}
if (!timeo)
return -EAGAIN;
}

if (!atomic_read(&conn->bytes_to_rcv)) {
Expand Down

0 comments on commit 846e344

Please sign in to comment.