mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
net/smc: put sk reference if close work was canceled
[ Upstream commit aa96fbd6d78d9770323b21e2c92bd38821be8852 ]
Note that we always hold a reference to sock when attempting
to submit close_work. Therefore, if we have successfully
canceled close_work from pending, we MUST release that reference
to avoid potential leaks.
Fixes: 42bfba9eaa
("net/smc: immediate termination for SMCD link groups")
Signed-off-by: D. Wythe <alibuda@linux.alibaba.com>
Reviewed-by: Dust Li <dust.li@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
f9eb4baabd
commit
fdfccd3dcb
1 changed files with 2 additions and 1 deletions
|
@ -116,7 +116,8 @@ static void smc_close_cancel_work(struct smc_sock *smc)
|
|||
struct sock *sk = &smc->sk;
|
||||
|
||||
release_sock(sk);
|
||||
cancel_work_sync(&smc->conn.close_work);
|
||||
if (cancel_work_sync(&smc->conn.close_work))
|
||||
sock_put(sk);
|
||||
cancel_delayed_work_sync(&smc->conn.tx_work);
|
||||
lock_sock(sk);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue