From: Hans Wippel Date: Thu, 21 Sep 2017 07:16:27 +0000 (+0200) Subject: net/smc: add receive timeout check X-Git-Tag: v4.14-rc2~10^2~5^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=846e344eb7229018457d6d6fc1ab0cc0a167692f;p=platform%2Fkernel%2Flinux-rpi3.git 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 Signed-off-by: Ursula Braun Signed-off-by: David S. Miller --- 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)) {