Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Sigh, fix another stupid mistake in previous that s...



details:   https://anonhg.NetBSD.org/src/rev/d0ea30437e3c
branches:  trunk
changeset: 320005:d0ea30437e3c
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Jun 19 04:10:51 2018 +0000

description:
Sigh, fix another stupid mistake in previous that squeaked by because,
again, I booted the wrong test kernel.

diffstat:

 sys/kern/subr_autoconf.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (35 lines):

diff -r fea79c1f34fc -r d0ea30437e3c sys/kern/subr_autoconf.c
--- a/sys/kern/subr_autoconf.c  Tue Jun 19 02:08:12 2018 +0000
+++ b/sys/kern/subr_autoconf.c  Tue Jun 19 04:10:51 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.259 2018/06/18 16:31:42 thorpej Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.260 2018/06/19 04:10:51 thorpej Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.259 2018/06/18 16:31:42 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.260 2018/06/19 04:10:51 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -2286,12 +2286,13 @@
 {
        const char **cpp = DEVICE_COMPAT_ENTRY_GET_STRINGS(dce);
 
-       if (cpp == NULL)
+       if (dce == NULL || cpp == NULL)
                return false;
        
-       while (*cpp != NULL)
-               if (strcmp(*cpp++, compatible) == 0)
+       for (; *cpp != NULL; cpp++) {
+               if (strcmp(*cpp, compatible) == 0)
                        return true;
+       }
 
        return false;
 }



Home | Main Index | Thread Index | Old Index