Source-Changes-HG archive

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

[src/trunk]: src/sys/compat Fix psref isn't released in a case of IFADDR_EMPTY



details:   https://anonhg.NetBSD.org/src/rev/c4685658f84b
branches:  trunk
changeset: 346288:c4685658f84b
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Tue Jul 05 07:55:08 2016 +0000

description:
Fix psref isn't released in a case of IFADDR_EMPTY

diffstat:

 sys/compat/linux/common/linux_socket.c     |  7 +++----
 sys/compat/linux32/common/linux32_socket.c |  7 +++----
 2 files changed, 6 insertions(+), 8 deletions(-)

diffs (56 lines):

diff -r 2907ca1d64b0 -r c4685658f84b sys/compat/linux/common/linux_socket.c
--- a/sys/compat/linux/common/linux_socket.c    Tue Jul 05 07:42:51 2016 +0000
+++ b/sys/compat/linux/common/linux_socket.c    Tue Jul 05 07:55:08 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_socket.c,v 1.129 2016/06/16 02:38:40 ozaki-r Exp $       */
+/*     $NetBSD: linux_socket.c,v 1.130 2016/07/05 07:55:08 ozaki-r Exp $       */
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.129 2016/06/16 02:38:40 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.130 2016/07/05 07:55:08 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1149,8 +1149,7 @@
                        error = ENAMETOOLONG;
                        goto release_exit;
                }
-               if (IFADDR_EMPTY(ifp))
-                       continue;
+
                IFADDR_FOREACH(ifa, ifp) {
                        sa = ifa->ifa_addr;
                        if (sa->sa_family != AF_INET ||
diff -r 2907ca1d64b0 -r c4685658f84b sys/compat/linux32/common/linux32_socket.c
--- a/sys/compat/linux32/common/linux32_socket.c        Tue Jul 05 07:42:51 2016 +0000
+++ b/sys/compat/linux32/common/linux32_socket.c        Tue Jul 05 07:55:08 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux32_socket.c,v 1.23 2016/06/16 02:38:40 ozaki-r Exp $ */
+/*     $NetBSD: linux32_socket.c,v 1.24 2016/07/05 08:48:51 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.23 2016/06/16 02:38:40 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.24 2016/07/05 08:48:51 ozaki-r Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -450,8 +450,7 @@
                        error = ENAMETOOLONG;
                        goto release_exit;
                }
-               if (IFADDR_EMPTY(ifp))
-                       continue;
+
                IFADDR_FOREACH(ifa, ifp) {
                        sa = ifa->ifa_addr;
                        if (sa->sa_family != AF_INET ||



Home | Main Index | Thread Index | Old Index