Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/atari/atari Restore NULL pointer checks lost in rev...



details:   https://anonhg.NetBSD.org/src/rev/bff281097e18
branches:  trunk
changeset: 366590:bff281097e18
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Tue May 31 15:24:59 2022 +0000

description:
Restore NULL pointer checks lost in rev 1.16.

Fixes PR port-atari/56859, ok'ed mlelstv@, and confirmed on TT030.
Should be pulled up to netbsd-9 and netbsd-8.

diffstat:

 sys/arch/atari/atari/stalloc.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 15a79c3c503c -r bff281097e18 sys/arch/atari/atari/stalloc.c
--- a/sys/arch/atari/atari/stalloc.c    Tue May 31 14:23:39 2022 +0000
+++ b/sys/arch/atari/atari/stalloc.c    Tue May 31 15:24:59 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: stalloc.c,v 1.16 2014/01/03 07:14:20 mlelstv Exp $     */
+/*     $NetBSD: stalloc.c,v 1.17 2022/05/31 15:24:59 tsutsui Exp $     */
 
 /*
  * Copyright (c) 1995 Leo Weppelman (Atari modifications)
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: stalloc.c,v 1.16 2014/01/03 07:14:20 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: stalloc.c,v 1.17 2022/05/31 15:24:59 tsutsui Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -163,7 +163,7 @@
        /*
         * check ahead of us.
         */
-       if (next->type == MNODE_FREE) {
+       if (next != NULL && next->type == MNODE_FREE) {
                /*
                 * if next is: a valid node and a free node. ==> merge
                 */
@@ -174,7 +174,7 @@
                stmem_total += mn->size + sizeof(struct mem_node);
                mn->size += next->size + sizeof(struct mem_node);
        }
-       if (prev->type == MNODE_FREE) {
+       if (prev != NULL && prev->type == MNODE_FREE) {
                /*
                 * if prev is: a valid node and a free node. ==> merge
                 */



Home | Main Index | Thread Index | Old Index