Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/arch/newsmips/apbus Pull up following revision(s) (re...



details:   https://anonhg.NetBSD.org/src/rev/36571eb0f289
branches:  netbsd-6
changeset: 777202:36571eb0f289
user:      snj <snj%NetBSD.org@localhost>
date:      Sat Aug 12 16:30:05 2017 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #1471):
        sys/arch/newsmips/apbus/if_sn.c: revision 1.39
Avoid memory leak in sonic_get.
If this is the first time around, top is null and nothing else will
free m.
>From Ilja Van Sprundel.

diffstat:

 sys/arch/newsmips/apbus/if_sn.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r e0363ba1dac3 -r 36571eb0f289 sys/arch/newsmips/apbus/if_sn.c
--- a/sys/arch/newsmips/apbus/if_sn.c   Sat Aug 12 16:26:31 2017 +0000
+++ b/sys/arch/newsmips/apbus/if_sn.c   Sat Aug 12 16:30:05 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_sn.c,v 1.33 2010/04/05 07:19:31 joerg Exp $ */
+/*     $NetBSD: if_sn.c,v 1.33.14.1 2017/08/12 16:30:05 snj Exp $      */
 
 /*
  * National Semiconductor  DP8393X SONIC Driver
@@ -16,7 +16,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.33 2010/04/05 07:19:31 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.33.14.1 2017/08/12 16:30:05 snj Exp $");
 
 #include "opt_inet.h"
 
@@ -1093,7 +1093,10 @@
                if (datalen >= MINCLSIZE) {
                        MCLGET(m, M_DONTWAIT);
                        if ((m->m_flags & M_EXT) == 0) {
-                               if (top) m_freem(top);
+                               if (top)
+                                       m_freem(top);
+                               else
+                                       m_freem(m);
                                return 0;
                        }
                        len = MCLBYTES;



Home | Main Index | Thread Index | Old Index