summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Raspl <stefan.raspl@linux.ibm.com>2018-05-03 17:57:39 +0200
committerDavid S. Miller <davem@davemloft.net>2018-05-03 14:47:31 -0400
commitbda27ff5c4526f80a7620a94ecfe8dca153e3696 (patch)
tree886341f8a24668c1f8a4a7c813f0404e9bb72187
parenta6920d1d130c3de039be982eba42542d329dc64c (diff)
smc: fix sendpage() call
The sendpage() call grabs the sock lock before calling the default implementation - which tries to grab it once again. Signed-off-by: Stefan Raspl <raspl@linux.ibm.com> Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>< Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/smc/af_smc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index d03b8d29ffc0..544bab42f925 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -1315,8 +1315,11 @@ static ssize_t smc_sendpage(struct socket *sock, struct page *page,
smc = smc_sk(sk);
lock_sock(sk);
- if (sk->sk_state != SMC_ACTIVE)
+ if (sk->sk_state != SMC_ACTIVE) {
+ release_sock(sk);
goto out;
+ }
+ release_sock(sk);
if (smc->use_fallback)
rc = kernel_sendpage(smc->clcsock, page, offset,
size, flags);
@@ -1324,7 +1327,6 @@ static ssize_t smc_sendpage(struct socket *sock, struct page *page,
rc = sock_no_sendpage(sock, page, offset, size, flags);
out:
- release_sock(sk);
return rc;
}