inet6: Clean up failure path in do_ipv6_setsockopt().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Wed, 19 Oct 2022 22:36:03 +0000 (15:36 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Oct 2022 08:40:39 +0000 (09:40 +0100)
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>
net/ipv6/ipv6_sockglue.c

index 532f447..9ce5168 100644 (file)
@@ -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,