From b45a337f061e131bd01b6df2d89f1228d4350a85 Mon Sep 17 00:00:00 2001 From: Kuniyuki Iwashima Date: Wed, 19 Oct 2022 15:36:03 -0700 Subject: [PATCH] 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 --- net/ipv6/ipv6_sockglue.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 532f4478c884..9ce51680290b 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,