From: Kuniyuki Iwashima Date: Wed, 19 Oct 2022 22:36:03 +0000 (-0700) Subject: inet6: Clean up failure path in do_ipv6_setsockopt(). X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b45a337f061e131bd01b6df2d89f1228d4350a85;p=linux.git inet6: Clean up failure path in do_ipv6_setsockopt(). We can reuse the unlock label above and need not repeat the same code. Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller --- diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 532f4478c8840..9ce51680290b1 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -1005,10 +1005,8 @@ unlock: return retv; e_inval: - sockopt_release_sock(sk); - if (needs_rtnl) - rtnl_unlock(); - return -EINVAL; + retv = -EINVAL; + goto unlock; } int ipv6_setsockopt(struct sock *sk, int level, int optname, sockptr_t optval,