]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tipc: fix a missing rhashtable_walk_exit()
authorCong Wang <xiyou.wangcong@gmail.com>
Thu, 23 Aug 2018 23:19:44 +0000 (16:19 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Sep 2018 07:46:42 +0000 (09:46 +0200)
[ Upstream commit bd583fe30427500a2d0abe25724025b1cb5e2636 ]

rhashtable_walk_exit() must be paired with rhashtable_walk_enter().

Fixes: 40f9f4397060 ("tipc: Fix tipc_sk_reinit race conditions")
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/tipc/socket.c

index 930852c54d7a6e97207c61a7c942e487781457e7..0a5fa347135e6e99d0cea4a24d0e78cd9ea8c8ae 100644 (file)
@@ -2675,6 +2675,8 @@ void tipc_sk_reinit(struct net *net)
 
                rhashtable_walk_stop(&iter);
        } while (tsk == ERR_PTR(-EAGAIN));
+
+       rhashtable_walk_exit(&iter);
 }
 
 static struct tipc_sock *tipc_sk_lookup(struct net *net, u32 portid)