net/smc: put sk reference if close work was canceled
authorD. Wythe <alibuda@linux.alibaba.com>
Fri, 3 Nov 2023 06:07:40 +0000 (14:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:52:16 +0000 (11:52 +0100)
commitf4277cb5626ba5eb60e70d993be37798c14078ed
tree8269a9a3a51e572efc83718fdea224a0592800c1
parent2d563aa75226192c0abf97292c78ecff5296ed69
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: 42bfba9eaa33 ("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>
net/smc/smc_close.c