diff options
author | Hans Wippel <hwippel@linux.vnet.ibm.com> | 2017-09-21 10:16:27 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-09-22 01:31:02 +0300 |
commit | 846e344eb7229018457d6d6fc1ab0cc0a167692f (patch) | |
tree | 9ab133d4307f2d273a571565d62e2dd7695c4e81 /net/smc | |
parent | 09579ac803a3638344b8544b5940793d5358673e (diff) | |
download | linux-846e344eb7229018457d6d6fc1ab0cc0a167692f.tar.xz |
net/smc: add receive timeout check
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>
Diffstat (limited to 'net/smc')
-rw-r--r-- | net/smc/smc_rx.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c index b17a333e9bb0..3e631ae4b6b6 100644 --- a/net/smc/smc_rx.c +++ b/net/smc/smc_rx.c @@ -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)) { |