Module Name:    src
Committed By:   ozaki-r
Date:           Tue Dec  6 01:23:01 UTC 2016

Modified Files:
        src/sys/net: if.c

Log Message:
Fix memory leak of struct if_percpuq on interface destruction


To generate a diff of this commit:
cvs rdiff -u -r1.362 -r1.363 src/sys/net/if.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.362 src/sys/net/if.c:1.363
--- src/sys/net/if.c:1.362	Tue Nov 15 01:50:06 2016
+++ src/sys/net/if.c	Tue Dec  6 01:23:01 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.362 2016/11/15 01:50:06 ozaki-r Exp $	*/
+/*	$NetBSD: if.c,v 1.363 2016/12/06 01:23:01 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.362 2016/11/15 01:50:06 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.363 2016/12/06 01:23:01 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -833,6 +833,7 @@ if_percpuq_destroy(struct if_percpuq *ip
 	softint_disestablish(ipq->ipq_si);
 	percpu_foreach(ipq->ipq_ifqs, &if_percpuq_purge_ifq, NULL);
 	percpu_free(ipq->ipq_ifqs, sizeof(struct ifqueue));
+	kmem_free(ipq, sizeof(*ipq));
 }
 
 void

Reply via email to