Skip to content

Commit bda27ff

Browse files
Stefan Raspldavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Ursula Braun <[email protected]>< Signed-off-by: David S. Miller <[email protected]>
1 parent a6920d1 commit bda27ff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

net/smc/af_smc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,16 +1315,18 @@ static ssize_t smc_sendpage(struct socket *sock, struct page *page,
13151315

13161316
smc = smc_sk(sk);
13171317
lock_sock(sk);
1318-
if (sk->sk_state != SMC_ACTIVE)
1318+
if (sk->sk_state != SMC_ACTIVE) {
1319+
release_sock(sk);
13191320
goto out;
1321+
}
1322+
release_sock(sk);
13201323
if (smc->use_fallback)
13211324
rc = kernel_sendpage(smc->clcsock, page, offset,
13221325
size, flags);
13231326
else
13241327
rc = sock_no_sendpage(sock, page, offset, size, flags);
13251328

13261329
out:
1327-
release_sock(sk);
13281330
return rc;
13291331
}
13301332

0 commit comments

Comments
 (0)