Module Name: src Committed By: thorpej Date: Fri May 14 02:48:43 UTC 2021
Modified Files: src/sys/dev/ofw [thorpej-i2c-spi-conf]: ofw_i2c_subr.c Log Message: Skip nodes without a "compatible" property. To generate a diff of this commit: cvs rdiff -u -r1.1.6.4 -r1.1.6.5 src/sys/dev/ofw/ofw_i2c_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ofw/ofw_i2c_subr.c diff -u src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.4 src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.5 --- src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.4 Fri May 14 01:52:36 2021 +++ src/sys/dev/ofw/ofw_i2c_subr.c Fri May 14 02:48:43 2021 @@ -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 @@ of_i2c_enumerate_devices(device_t dev, d } 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) <