Module Name:    src
Committed By:   snj
Date:           Fri Aug 11 15:31:49 UTC 2017

Modified Files:
        src/sys/arch/mac68k/nubus [netbsd-7-0]: if_netdock_nubus.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1468):
        sys/arch/mac68k/nubus/if_netdock_nubus.c: revision 1.26
Avoid memory leak in netdock_get.
If top is null, this is the first time through and nothing else will
free m.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.16.1 src/sys/arch/mac68k/nubus/if_netdock_nubus.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/arch/mac68k/nubus/if_netdock_nubus.c
diff -u src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.22 src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.22.16.1
--- src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.22	Sat Oct 27 17:17:59 2012
+++ src/sys/arch/mac68k/nubus/if_netdock_nubus.c	Fri Aug 11 15:31:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_netdock_nubus.c,v 1.22 2012/10/27 17:17:59 chs Exp $	*/
+/*	$NetBSD: if_netdock_nubus.c,v 1.22.16.1 2017/08/11 15:31:49 snj Exp $	*/
 
 /*
  * Copyright (C) 2000,2002 Daishi Kato <dai...@axlight.com>
@@ -43,7 +43,7 @@
 /***********************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.22 2012/10/27 17:17:59 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.22.16.1 2017/08/11 15:31:49 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -804,6 +804,8 @@ netdock_get(struct netdock_softc *sc, in
 			if ((m->m_flags & M_EXT) == 0) {
 				if (top)
 					m_freem(top);
+				else
+					m_freem(m);
 				return (NULL);
 			}
 			len = MCLBYTES;

Reply via email to