diff options
author | Hans Wippel <hwippel@linux.vnet.ibm.com> | 2017-09-21 09:16:27 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-09-21 15:31:02 -0700 |
commit | 846e344eb7229018457d6d6fc1ab0cc0a167692f (patch) | |
tree | 9ab133d4307f2d273a571565d62e2dd7695c4e81 | |
parent | 09579ac803a3638344b8544b5940793d5358673e (diff) | |
download | op-kernel-dev-846e344eb7229018457d6d6fc1ab0cc0a167692f.zip op-kernel-dev-846e344eb7229018457d6d6fc1ab0cc0a167692f.tar.gz |
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>
-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 b17a333..3e631ae 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)) { |