summaryrefslogtreecommitdiffstats
path: root/sys/dev/ofw/openfirm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ofw/openfirm.c')
-rw-r--r--sys/dev/ofw/openfirm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/ofw/openfirm.c b/sys/dev/ofw/openfirm.c
index 762e859..d7adc96 100644
--- a/sys/dev/ofw/openfirm.c
+++ b/sys/dev/ofw/openfirm.c
@@ -394,6 +394,9 @@ OF_getencprop(phandle_t node, const char *propname, pcell_t *buf, size_t len)
KASSERT(len % 4 == 0, ("Need a multiple of 4 bytes"));
retval = OF_getprop(node, propname, buf, len);
+ if (retval <= 0)
+ return (retval);
+
for (i = 0; i < len/4; i++)
buf[i] = be32toh(buf[i]);
OpenPOWER on IntegriCloud