summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@gmail.com>2020-09-24 02:30:01 +0200
committerDavid S. Miller <davem@davemloft.net>2020-09-25 04:58:34 +0200
commit08b81d873126b413cda511b1ea1cbb0e99938bbd (patch)
tree39601f9ec6ee0898cd3f10287ba78d423caefe1c /net/core
parentmptcp: add struct mptcp_pm_add_entry (diff)
downloadlinux-08b81d873126b413cda511b1ea1cbb0e99938bbd.tar.xz
linux-08b81d873126b413cda511b1ea1cbb0e99938bbd.zip
mptcp: add sk_stop_timer_sync helper
This patch added a new helper sk_stop_timer_sync, it deactivates a timer like sk_stop_timer, but waits for the handler to finish. Acked-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Geliang Tang <geliangtang@gmail.com> Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/sock.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index ba9e7d91e2ef..d9a537e6876a 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2947,6 +2947,13 @@ void sk_stop_timer(struct sock *sk, struct timer_list* timer)
}
EXPORT_SYMBOL(sk_stop_timer);
+void sk_stop_timer_sync(struct sock *sk, struct timer_list *timer)
+{
+ if (del_timer_sync(timer))
+ __sock_put(sk);
+}
+EXPORT_SYMBOL(sk_stop_timer_sync);
+
void sock_init_data(struct socket *sock, struct sock *sk)
{
sk_init_common(sk);