Skip to content

Commit

Permalink
sctp: remove the out_nounlock label in sctp_setsockopt
Browse files Browse the repository at this point in the history
This is just used once, and a direct return for the redirect to the AF
case is much easier to follow than jumping to the end of a very long
function.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Christoph Hellwig authored and David S. Miller committed Jul 20, 2020
1 parent 26feba8 commit 6c8983a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -4444,8 +4444,8 @@ static int sctp_setsockopt(struct sock *sk, int level, int optname,
*/
if (level != SOL_SCTP) {
struct sctp_af *af = sctp_sk(sk)->pf->af;
retval = af->setsockopt(sk, level, optname, optval, optlen);
goto out_nounlock;

return af->setsockopt(sk, level, optname, optval, optlen);
}

if (optlen > 0) {
Expand Down Expand Up @@ -4635,8 +4635,6 @@ static int sctp_setsockopt(struct sock *sk, int level, int optname,

release_sock(sk);
kfree(kopt);

out_nounlock:
return retval;
}

Expand Down

0 comments on commit 6c8983a

Please sign in to comment.