svn commit: r257747 - head/sys/dev/ofw

Nathan Whitehorn nwhitehorn at FreeBSD.org
Wed Nov 6 14:38:54 UTC 2013


Author: nwhitehorn
Date: Wed Nov  6 14:38:53 2013
New Revision: 257747
URL: http://svnweb.freebsd.org/changeset/base/257747

Log:
  An addendum: it is possible, though of questionable utility, for a node
  to have no properties at all. Do the right thing in such cases.

Modified:
  head/sys/dev/ofw/ofw_fdt.c

Modified: head/sys/dev/ofw/ofw_fdt.c
==============================================================================
--- head/sys/dev/ofw/ofw_fdt.c	Wed Nov  6 14:36:38 2013	(r257746)
+++ head/sys/dev/ofw/ofw_fdt.c	Wed Nov  6 14:38:53 2013	(r257747)
@@ -283,6 +283,8 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t pa
 
 	/* Find the first prop in the node */
 	offset = fdt_first_property_offset(fdtp, offset);
+	if (offset < 0)
+		return (0); /* No properties */
 
 	if (previous != NULL) {
 		while (offset >= 0) {


More information about the svn-src-head mailing list