Module Name: src
Committed By: phx
Date: Fri Jan 15 20:57:25 UTC 2010
Modified Files:
src/sys/arch/ofppc/ofppc: mainbus.c
Log Message:
Fixed crash, when /rtas was not found: OF_finddevice() returns -1 when
the device is not found.
To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/ofppc/ofppc/mainbus.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/ofppc/ofppc/mainbus.c
diff -u src/sys/arch/ofppc/ofppc/mainbus.c:1.23 src/sys/arch/ofppc/ofppc/mainbus.c:1.24
--- src/sys/arch/ofppc/ofppc/mainbus.c:1.23 Mon Apr 28 20:23:31 2008
+++ src/sys/arch/ofppc/ofppc/mainbus.c Fri Jan 15 20:57:25 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: mainbus.c,v 1.23 2008/04/28 20:23:31 martin Exp $ */
+/* $NetBSD: mainbus.c,v 1.24 2010/01/15 20:57:25 phx Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.23 2008/04/28 20:23:31 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.24 2010/01/15 20:57:25 phx Exp $");
#include "opt_interrupt.h"
#include "opt_multiprocessor.h"
@@ -233,7 +233,7 @@
/* Find rtas first */
rtnode = OF_finddevice("/rtas");
- if (rtnode) {
+ if (rtnode != -1) {
memset(name, 0, sizeof(name));
if (OF_getprop(rtnode, "name", name, sizeof(name)) != -1) {
ca.ca_name = name;