Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sgimips/dev don't malloc a tiny, fixed size buffer ...



details:   https://anonhg.NetBSD.org/src/rev/9709c49f28da
branches:  trunk
changeset: 337149:9709c49f28da
user:      macallan <macallan%NetBSD.org@localhost>
date:      Sat Apr 04 14:12:40 2015 +0000

description:
don't malloc a tiny, fixed size buffer to scribble into, then not use it
and never free it either

found by Brainy

diffstat:

 sys/arch/sgimips/dev/scn.c |  8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diffs (36 lines):

diff -r adeccec6c62c -r 9709c49f28da sys/arch/sgimips/dev/scn.c
--- a/sys/arch/sgimips/dev/scn.c        Sat Apr 04 13:59:20 2015 +0000
+++ b/sys/arch/sgimips/dev/scn.c        Sat Apr 04 14:12:40 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scn.c,v 1.7 2014/07/25 08:10:34 dholland Exp $ */
+/*     $NetBSD: scn.c,v 1.8 2015/04/04 14:12:40 macallan Exp $ */
 
 /*
  * Resurrected from the old pc532 port 1/18/2009.
@@ -92,7 +92,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scn.c,v 1.7 2014/07/25 08:10:34 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scn.c,v 1.8 2015/04/04 14:12:40 macallan Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -815,7 +815,6 @@
        u_char mr1, mr2;
        enum scntype scntype = SCNUNK;
        const char *duart_type = "Unknown";
-       char *intrname;
        bool console, first;
        devmajor_t major;
 
@@ -906,9 +905,6 @@
                ch_base[CH_MR] = mr2;
                splx(s);
 
-               intrname = malloc(sizeof("scnXX"), M_DEVBUF, M_NOWAIT);
-               snprintf(intrname, sizeof("scnXX"), "scn%d", unit);
-
                /*
                 * On IP6 the console chip is duart1. The keyboard/mouse
                 * is duart0. Each chip has two channels and the channels



Home | Main Index | Thread Index | Old Index