summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@amazon.com>2022-10-20 00:36:03 +0200
committerDavid S. Miller <davem@davemloft.net>2022-10-24 10:40:39 +0200
commitb45a337f061e131bd01b6df2d89f1228d4350a85 (patch)
treee4be7dced15359adc7c6a00b3890d9ae0e7a4b0f /net/ipv6
parentinet6: Remove inet6_destroy_sock(). (diff)
downloadlinux-b45a337f061e131bd01b6df2d89f1228d4350a85.tar.xz
linux-b45a337f061e131bd01b6df2d89f1228d4350a85.zip
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,