mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
net/smc: do not schedule tx_work in SMC_CLOSED state
The setsockopts options TCP_NODELAY and TCP_CORK may schedule the
tx worker. Make sure the socket is not yet moved into SMC_CLOSED
state (for instance by a shutdown SHUT_RDWR call).
Reported-by: [email protected]
Reported-by: [email protected]
Fixes: 01d2f7e2cd ("net/smc: sockopts TCP_NODELAY and TCP_CORK")
Signed-off-by: Ursula Braun <[email protected]>
Signed-off-by: Karsten Graul <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
438b43bdb9
commit
f9cedf1a9b
1 changed files with 6 additions and 2 deletions
|
|
@ -1732,14 +1732,18 @@ static int smc_setsockopt(struct socket *sock, int level, int optname,
|
|||
}
|
||||
break;
|
||||
case TCP_NODELAY:
|
||||
if (sk->sk_state != SMC_INIT && sk->sk_state != SMC_LISTEN) {
|
||||
if (sk->sk_state != SMC_INIT &&
|
||||
sk->sk_state != SMC_LISTEN &&
|
||||
sk->sk_state != SMC_CLOSED) {
|
||||
if (val && !smc->use_fallback)
|
||||
mod_delayed_work(system_wq, &smc->conn.tx_work,
|
||||
0);
|
||||
}
|
||||
break;
|
||||
case TCP_CORK:
|
||||
if (sk->sk_state != SMC_INIT && sk->sk_state != SMC_LISTEN) {
|
||||
if (sk->sk_state != SMC_INIT &&
|
||||
sk->sk_state != SMC_LISTEN &&
|
||||
sk->sk_state != SMC_CLOSED) {
|
||||
if (!val && !smc->use_fallback)
|
||||
mod_delayed_work(system_wq, &smc->conn.tx_work,
|
||||
0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue