Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/ia64/stand/common fix uninitialized variable



details:   https://anonhg.NetBSD.org/src/rev/b1f7a2f7d9e7
branches:  trunk
changeset: 787658:b1f7a2f7d9e7
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jun 27 21:22:16 2013 +0000

description:
fix uninitialized variable
http://M00nBSD.net/ae123a9bae03f7dde5c6d654412daf5a.html

diffstat:

 sys/arch/ia64/stand/common/fileload.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 055451ecc04b -r b1f7a2f7d9e7 sys/arch/ia64/stand/common/fileload.c
--- a/sys/arch/ia64/stand/common/fileload.c     Thu Jun 27 21:21:05 2013 +0000
+++ b/sys/arch/ia64/stand/common/fileload.c     Thu Jun 27 21:22:16 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fileload.c,v 1.3 2012/12/27 20:21:51 martin Exp $      */
+/*     $NetBSD: fileload.c,v 1.4 2013/06/27 21:22:16 christos Exp $    */
 
 /*-
  * Copyright (c) 1998 Michael Smith <msmith%freebsd.org@localhost>
@@ -61,7 +61,7 @@
 command_load(int argc, char *argv[])
 {
     char       *typestr;
-    int                dofile, dokld, ch, error;
+    int                dofile, dokld, ch;
     
     dokld = dofile = 0;
     optind = 1;
@@ -89,11 +89,12 @@
      * Do we have explicit KLD load ?
      */
     if (dokld || file_havepath(argv[1])) {
-       error = file_loadkernel(argv[1], argc - 2, argv + 2);
+       int error = file_loadkernel(argv[1], argc - 2, argv + 2);
        if (error == EEXIST)
            sprintf(command_errbuf, "warning: KLD '%s' already loaded", argv[1]);
+       return error == 0 ? CMD_OK : CMD_ERROR;
     }
-    return (error == 0 ? CMD_OK : CMD_ERROR);
+    return CMD_OK;
 }
 
 



Home | Main Index | Thread Index | Old Index