Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet Reduce return points (NFC)



details:   https://anonhg.NetBSD.org/src/rev/4971e8daad4f
branches:  trunk
changeset: 357563:4971e8daad4f
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Wed Nov 15 09:54:18 2017 +0000

description:
Reduce return points (NFC)

diffstat:

 sys/netinet/tcp_input.c |  19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diffs (60 lines):

diff -r a435fb5123dd -r 4971e8daad4f sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c   Wed Nov 15 09:21:48 2017 +0000
+++ b/sys/netinet/tcp_input.c   Wed Nov 15 09:54:18 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_input.c,v 1.360 2017/08/03 06:32:51 ozaki-r Exp $  */
+/*     $NetBSD: tcp_input.c,v 1.361 2017/11/15 09:54:18 ozaki-r Exp $  */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.360 2017/08/03 06:32:51 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.361 2017/11/15 09:54:18 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -3806,15 +3806,12 @@
 
        mutex_enter(softnet_lock);
        KERNEL_LOCK(1, NULL);
+
        callout_ack(&sc->sc_timer);
 
        if (__predict_false(sc->sc_flags & SCF_DEAD)) {
                TCP_STATINC(TCP_STAT_SC_DELAYED_FREE);
-               callout_destroy(&sc->sc_timer);
-               pool_put(&syn_cache_pool, sc);
-               KERNEL_UNLOCK_ONE(NULL);
-               mutex_exit(softnet_lock);
-               return;
+               goto free;
        }
 
        if (__predict_false(sc->sc_rxtshift == TCP_MAXRXTSHIFT)) {
@@ -3838,9 +3835,7 @@
        sc->sc_rxtshift++;
        SYN_CACHE_TIMER_ARM(sc);
 
-       KERNEL_UNLOCK_ONE(NULL);
-       mutex_exit(softnet_lock);
-       return;
+       goto out;
 
  dropit:
        TCP_STATINC(TCP_STAT_SC_TIMED_OUT);
@@ -3848,8 +3843,12 @@
        if (sc->sc_ipopts)
                (void) m_free(sc->sc_ipopts);
        rtcache_free(&sc->sc_route);
+
+ free:
        callout_destroy(&sc->sc_timer);
        pool_put(&syn_cache_pool, sc);
+
+ out:
        KERNEL_UNLOCK_ONE(NULL);
        mutex_exit(softnet_lock);
 }



Home | Main Index | Thread Index | Old Index