[PATCH mptcp-next 03/16] mptcp: pm: retrans ADD_ADDR: free sk if last

Matthieu Baerts (NGI0) posted 16 patches 1 day, 14 hours ago
There is a newer version of this series
[PATCH mptcp-next 03/16] mptcp: pm: retrans ADD_ADDR: free sk if last
Posted by Matthieu Baerts (NGI0) 1 day, 14 hours ago
When an ADD_ADDR is retransmitted, the sk is held in sk_reset_timer(),
and released at the end.

If at that moment, it was the last reference being held, the sk would
not be freed. sock_put() should then be called instead of __sock_put().

Fixes: 00cfd77b9063 ("mptcp: retransmit ADD_ADDR when timeout")
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index f7c9a1f94d50..2cefc9b6c1b8 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -365,7 +365,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer)
 		mptcp_pm_subflow_established(msk);
 
 out:
-	__sock_put(sk);
+	sock_put(sk);
 }
 
 struct mptcp_pm_add_entry *

-- 
2.53.0