summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@amazon.com>2022-10-19 15:36:03 -0700
committerDavid S. Miller <davem@davemloft.net>2022-10-24 09:40:39 +0100
commitb45a337f061e131bd01b6df2d89f1228d4350a85 (patch)
treee4be7dced15359adc7c6a00b3890d9ae0e7a4b0f /net/ipv6
parent1f8c4eeb945553baf868bbec7a8c59810df97a07 (diff)
downloadlinux-b45a337f061e131bd01b6df2d89f1228d4350a85.tar.bz2
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 <kuniyu@amazon.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/ipv6_sockglue.c6
1 files 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,