Skip to content

Commit

Permalink
inet6: Clean up failure path in do_ipv6_setsockopt().
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kuniyuki Iwashima authored and David S. Miller committed Oct 24, 2022
1 parent 1f8c4ee commit b45a337
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/ipv6/ipv6_sockglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,10 +1005,8 @@ int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
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,
Expand Down

0 comments on commit b45a337

Please sign in to comment.