diff options
author | Stefan Raspl <stefan.raspl@linux.ibm.com> | 2018-05-03 17:57:39 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-03 20:47:31 +0200 |
commit | bda27ff5c4526f80a7620a94ecfe8dca153e3696 (patch) | |
tree | 886341f8a24668c1f8a4a7c813f0404e9bb72187 /net | |
parent | net/smc: handle unregistered buffers (diff) | |
download | linux-bda27ff5c4526f80a7620a94ecfe8dca153e3696.tar.xz linux-bda27ff5c4526f80a7620a94ecfe8dca153e3696.zip |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/smc/af_smc.c | 6 |
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; } |