Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/ofppc/ofppc Fixed crash, when /rtas was not found: ...



details:   https://anonhg.NetBSD.org/src/rev/8f31a97c2d03
branches:  trunk
changeset: 750825:8f31a97c2d03
user:      phx <phx%NetBSD.org@localhost>
date:      Fri Jan 15 20:57:25 2010 +0000

description:
Fixed crash, when /rtas was not found: OF_finddevice() returns -1 when
the device is not found.

diffstat:

 sys/arch/ofppc/ofppc/mainbus.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 785980b3d810 -r 8f31a97c2d03 sys/arch/ofppc/ofppc/mainbus.c
--- a/sys/arch/ofppc/ofppc/mainbus.c    Fri Jan 15 20:57:12 2010 +0000
+++ b/sys/arch/ofppc/ofppc/mainbus.c    Fri Jan 15 20:57:25 2010 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index