From a52ec6de6d1638e8c203d7188c55627f75371612 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Tue, 8 Dec 2015 14:13:19 +0800 Subject: netlink: Add missing goto statement to netlink_insert The backport of 1f770c0a09da855a2b51af6d19de97fb955eca85 ("netlink: Fix autobind race condition that leads to zero port ID") missed a goto statement, which causes netlink to break subtly. This was discovered by Stefan Priebe . Fixes: 4e2776241766 ("netlink: Fix autobind race condition that...") Reported-by: Stefan Priebe Reported-by: Philipp Hahn Signed-off-by: Herbert Xu Acked-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/netlink/af_netlink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index d139c43ac6e5..0d6038c87bef 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -1118,6 +1118,7 @@ static int netlink_insert(struct sock *sk, u32 portid) if (err == -EEXIST) err = -EADDRINUSE; sock_put(sk); + goto err; } /* We need to ensure that the socket is hashed and visible. */ -- cgit v1.2.3