Source-Changes-HG archive

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

[src/trunk]: src/sys/net Add missing ifa_release on error paths



details:   https://anonhg.NetBSD.org/src/rev/70597198dd2f
branches:  trunk
changeset: 997528:70597198dd2f
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon Mar 11 03:00:41 2019 +0000

description:
Add missing ifa_release on error paths

diffstat:

 sys/net/route.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 8cb5e132a782 -r 70597198dd2f sys/net/route.c
--- a/sys/net/route.c   Mon Mar 11 01:40:05 2019 +0000
+++ b/sys/net/route.c   Mon Mar 11 03:00:41 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: route.c,v 1.216 2018/10/30 05:56:02 ozaki-r Exp $      */
+/*     $NetBSD: route.c,v 1.217 2019/03/11 03:00:41 ozaki-r Exp $      */
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.216 2018/10/30 05:56:02 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.217 2019/03/11 03:00:41 ozaki-r Exp $");
 
 #include <sys/param.h>
 #ifdef RTFLUSH_DEBUG
@@ -1504,6 +1504,8 @@
                }
                if (new_ifa == NULL)
                        ifa_release(ifa, &psref_ifa);
+               /* To avoid ifa_release below */
+               ifa = NULL;
        }
        ifa_release(new_ifa, &psref_new_ifa);
        if (new_ifp && rt->rt_ifp != new_ifp && !if_is_deactivated(new_ifp)) {
@@ -1525,6 +1527,7 @@
        (void)ifp_changed; /* XXX gcc */
 #endif
 out:
+       ifa_release(ifa, &psref_ifa);
        if_put(new_ifp, &psref_new_ifp);
        if_put(ifp, &psref_ifp);
 



Home | Main Index | Thread Index | Old Index