diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2013-11-06 14:38:53 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2013-11-06 14:38:53 +0000 |
commit | 29f9888203a389ec7d96382173995c9c7cfeb42c (patch) | |
tree | 5ddb8b4d29c9237c1b02ee354fc01753443360f4 | |
parent | a66ab9aa824933489c78b10f2af6addde2038ae0 (diff) | |
download | FreeBSD-src-29f9888203a389ec7d96382173995c9c7cfeb42c.zip FreeBSD-src-29f9888203a389ec7d96382173995c9c7cfeb42c.tar.gz |
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.
-rw-r--r-- | sys/dev/ofw/ofw_fdt.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) { |