From 29f9888203a389ec7d96382173995c9c7cfeb42c Mon Sep 17 00:00:00 2001 From: nwhitehorn Date: Wed, 6 Nov 2013 14:38:53 +0000 Subject: 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. --- sys/dev/ofw/ofw_fdt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/ofw/ofw_fdt.c b/sys/dev/ofw/ofw_fdt.c index 8c739a0..b53bdab 100644 --- a/sys/dev/ofw/ofw_fdt.c +++ b/sys/dev/ofw/ofw_fdt.c @@ -283,6 +283,8 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t package, const char *previous, char *buf, /* 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) { -- cgit v1.1