From 437a9cead6e635e00f586e892cab9b6ce45223b2 Mon Sep 17 00:00:00 2001 From: kettenis Date: Tue, 23 Aug 2016 18:12:09 +0000 Subject: [PATCH] Actually make fdt_find_node() return NULL if the node couldn't be found. ok tom@ --- sys/dev/ofw/fdt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/ofw/fdt.c b/sys/dev/ofw/fdt.c index 0a1f0138a1e..b589bf1c645 100644 --- a/sys/dev/ofw/fdt.c +++ b/sys/dev/ofw/fdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fdt.c,v 1.18 2016/07/26 22:10:10 patrick Exp $ */ +/* $OpenBSD: fdt.c,v 1.19 2016/08/23 18:12:09 kettenis Exp $ */ /* * Copyright (c) 2009 Dariusz Swiderski @@ -410,6 +410,9 @@ fdt_find_node(char *name) } } + if (child == NULL) + return NULL; /* No match found. */ + p = q; } -- 2.20.1