Browse Source

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>
Hans Wippel 8 years ago
parent
commit
846e344eb7
1 changed files with 2 additions and 0 deletions
  1. 2 0
      net/smc/smc_rx.c

+ 2 - 0
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);
 				read_done = sock_intr_errno(timeo);
 				break;
 				break;
 			}
 			}
+			if (!timeo)
+				return -EAGAIN;
 		}
 		}
 
 
 		if (!atomic_read(&conn->bytes_to_rcv)) {
 		if (!atomic_read(&conn->bytes_to_rcv)) {