Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Nov 2013 14:38:54 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r257747 - head/sys/dev/ofw
Message-ID:  <201311061438.rA6Ecskd010976@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311061438.rA6Ecskd010976>