Source-Changes-HG archive

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

[src/thorpej-i2c-spi-conf]: src/sys/dev/ofw Skip nodes without a "compatible"...



details:   https://anonhg.NetBSD.org/src/rev/a8d442520181
branches:  thorpej-i2c-spi-conf
changeset: 1020803:a8d442520181
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri May 14 02:48:43 2021 +0000

description:
Skip nodes without a "compatible" property.

diffstat:

 sys/dev/ofw/ofw_i2c_subr.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 28a8a6ebe414 -r a8d442520181 sys/dev/ofw/ofw_i2c_subr.c
--- a/sys/dev/ofw/ofw_i2c_subr.c        Fri May 14 01:52:36 2021 +0000
+++ b/sys/dev/ofw/ofw_i2c_subr.c        Fri May 14 02:48:43 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofw_i2c_subr.c,v 1.1.6.4 2021/05/14 01:52:36 thorpej Exp $     */
+/*     $NetBSD: ofw_i2c_subr.c,v 1.1.6.5 2021/05/14 02:48:43 thorpej Exp $     */
 
 /*
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_i2c_subr.c,v 1.1.6.4 2021/05/14 01:52:36 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_i2c_subr.c,v 1.1.6.5 2021/05/14 02:48:43 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -176,6 +176,9 @@
                }
 
                clist_size = OF_getproplen(node, "compatible");
+               if (clist_size <= 0) {
+                       continue;
+               }
                clist = kmem_tmpbuf_alloc(clist_size,
                    compat_buf, sizeof(compat_buf), KM_SLEEP);
                if (OF_getprop(node, "compatible", clist, clist_size) <



Home | Main Index | Thread Index | Old Index