Skip to content

Commit 9951bfa

Browse files
author
Xin Long
committed
inet6: Clean up failure path in do_ipv6_setsockopt().
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2160516 Tested: compile only Conflicts: - context difference due to missing commit 0f95f7d from upstream. commit b45a337 Author: Kuniyuki Iwashima <kuniyu@amazon.com> Date: Wed Oct 19 15:36:03 2022 -0700 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> Signed-off-by: Xin Long <lxin@redhat.com>
1 parent 48f2c50 commit 9951bfa

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

net/ipv6/ipv6_sockglue.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -989,10 +989,8 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
989989
return retv;
990990

991991
e_inval:
992-
release_sock(sk);
993-
if (needs_rtnl)
994-
rtnl_unlock();
995-
return -EINVAL;
992+
retv = -EINVAL;
993+
goto unlock;
996994
}
997995

998996
int ipv6_setsockopt(struct sock *sk, int level, int optname, sockptr_t optval,

0 commit comments

Comments
 (0)