Commit a52ec6de authored by Herbert Xu's avatar Herbert Xu Committed by Greg Kroah-Hartman

netlink: Add missing goto statement to netlink_insert

The backport of 1f770c0a ("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 <s.priebe@profihost.ag>.

Fixes: 4e277624 ("netlink: Fix autobind race condition that...")
Reported-by: default avatarStefan Priebe <s.priebe@profihost.ag>
Reported-by: default avatarPhilipp Hahn <pmhahn@pmhahn.de>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3f11689e
......@@ -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. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment