summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-06-26 12:45:23 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-06-26 12:45:23 +0000
commit8fc947a4b37fc3a8737a97217d86a287b0e45055 (patch)
treeb04289543a8df31dfd5bebfb60eb5f9adf401e07 /sys
parent9946c59860e45c29c4b5fb28f3d237c010dbecc1 (diff)
return early if either initrd property is missing
avoids unlikely path with use of uninitialised pointer found with scan-build, ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/powerpc64/powerpc64/db_interface.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/powerpc64/powerpc64/db_interface.c b/sys/arch/powerpc64/powerpc64/db_interface.c
index 02df878b041..7b026256d18 100644
--- a/sys/arch/powerpc64/powerpc64/db_interface.c
+++ b/sys/arch/powerpc64/powerpc64/db_interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_interface.c,v 1.1 2020/05/27 22:22:04 gkoehler Exp $ */
+/* $OpenBSD: db_interface.c,v 1.2 2020/06/26 12:45:22 jsg Exp $ */
/* $NetBSD: db_interface.c,v 1.12 2001/07/22 11:29:46 wiz Exp $ */
/*
@@ -57,7 +57,7 @@ db_machine_init(void)
* If an initrd exists, try to load symbols from there.
*/
node = fdt_find_node("/chosen");
- if (fdt_node_property(node, "linux,initrd-start", &prop_start) != 8 &&
+ if (fdt_node_property(node, "linux,initrd-start", &prop_start) != 8 ||
fdt_node_property(node, "linux,initrd-end", &prop_end) != 8) {
printf("[ no initrd ]\n");
return;