Source-Changes-HG archive

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

[src/trunk]: src/sys uninitialized variables



details:   https://anonhg.NetBSD.org/src/rev/7dd4cff9eb91
branches:  trunk
changeset: 554351:7dd4cff9eb91
user:      chs <chs%NetBSD.org@localhost>
date:      Mon Oct 27 07:07:34 2003 +0000

description:
uninitialized variables

diffstat:

 sys/arch/alpha/alpha/cpu.c                 |   6 +++---
 sys/arch/alpha/alpha/db_trace.c            |   8 ++++++--
 sys/arch/alpha/alpha/linux_syscall.c       |   6 +++---
 sys/arch/alpha/alpha/osf1_syscall.c        |   6 +++---
 sys/arch/alpha/alpha/pmap.c                |   7 ++++---
 sys/arch/alpha/alpha/syscall.c             |   6 +++---
 sys/arch/alpha/alpha/trap.c                |  10 +++++-----
 sys/compat/linux/common/linux_exec_elf32.c |  11 ++++++-----
 sys/compat/osf1/osf1_time.c                |  10 +++++-----
 sys/dev/pci/cz.c                           |   8 ++++----
 sys/dev/pci/tga.c                          |   6 +++---
 sys/dev/pcmcia/if_ray.c                    |   8 ++++----
 sys/dev/tc/cfb.c                           |   6 +++---
 sys/dev/tc/mfb.c                           |   6 +++---
 sys/dev/tc/px.c                            |   8 ++++----
 sys/dev/tc/pxg.c                           |   6 +++---
 sys/dev/tc/sfb.c                           |   6 +++---
 sys/dev/tc/stic.c                          |   6 +++---
 sys/dev/tc/tfb.c                           |   6 +++---
 19 files changed, 71 insertions(+), 65 deletions(-)

diffs (truncated from 592 to 300 lines):

diff -r 07dc2918b477 -r 7dd4cff9eb91 sys/arch/alpha/alpha/cpu.c
--- a/sys/arch/alpha/alpha/cpu.c        Mon Oct 27 06:19:29 2003 +0000
+++ b/sys/arch/alpha/alpha/cpu.c        Mon Oct 27 07:07:34 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.70 2003/02/05 12:16:41 nakayama Exp $ */
+/* $NetBSD: cpu.c,v 1.71 2003/10/27 07:07:35 chs Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.70 2003/02/05 12:16:41 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.71 2003/10/27 07:07:35 chs Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -395,7 +395,7 @@
 static void
 cpu_announce_extensions(struct cpu_info *ci)
 {
-       u_long implver, amask;
+       u_long implver, amask = 0;
        char bits[64];
 
        implver = alpha_implver();
diff -r 07dc2918b477 -r 7dd4cff9eb91 sys/arch/alpha/alpha/db_trace.c
--- a/sys/arch/alpha/alpha/db_trace.c   Mon Oct 27 06:19:29 2003 +0000
+++ b/sys/arch/alpha/alpha/db_trace.c   Mon Oct 27 07:07:34 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_trace.c,v 1.11 2003/10/23 10:05:53 ragge Exp $ */
+/* $NetBSD: db_trace.c,v 1.12 2003/10/27 07:07:35 chs Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.11 2003/10/23 10:05:53 ragge Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.12 2003/10/27 07:07:35 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -207,6 +207,8 @@
                addr = DDB_REGS->tf_regs[FRAME_SP] - FRAME_SIZE * 8;
                tf = (struct trapframe *)addr;
                have_trapframe = 1;
+               callpc = 0;
+               frame = 0;
        } else {
                if (trace_thread) {
                        (*pr)("trace: pid %d ", (int)addr);
@@ -229,7 +231,9 @@
                        return;
                }
                frame = addr;
+               tf = NULL;
        }
+       ra_from_tf = FALSE;
 
        while (count--) {
                if (have_trapframe) {
diff -r 07dc2918b477 -r 7dd4cff9eb91 sys/arch/alpha/alpha/linux_syscall.c
--- a/sys/arch/alpha/alpha/linux_syscall.c      Mon Oct 27 06:19:29 2003 +0000
+++ b/sys/arch/alpha/alpha/linux_syscall.c      Mon Oct 27 07:07:34 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_syscall.c,v 1.10 2003/01/17 22:11:18 thorpej Exp $ */
+/* $NetBSD: linux_syscall.c,v 1.11 2003/10/27 07:07:35 chs Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -102,7 +102,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.10 2003/01/17 22:11:18 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.11 2003/10/27 07:07:35 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -267,7 +267,7 @@
        const struct sysent *callp;
        int error;
        u_int64_t rval[2];
-       u_int64_t *args, copyargs[10];                          /* XXX */
+       u_int64_t *args = NULL, copyargs[10];                   /* XXX */
        u_int hidden, nargs;
        struct proc *p = l->l_proc;
 
diff -r 07dc2918b477 -r 7dd4cff9eb91 sys/arch/alpha/alpha/osf1_syscall.c
--- a/sys/arch/alpha/alpha/osf1_syscall.c       Mon Oct 27 06:19:29 2003 +0000
+++ b/sys/arch/alpha/alpha/osf1_syscall.c       Mon Oct 27 07:07:34 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_syscall.c,v 1.12 2003/01/17 22:11:18 thorpej Exp $ */
+/* $NetBSD: osf1_syscall.c,v 1.13 2003/10/27 07:07:35 chs Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -102,7 +102,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: osf1_syscall.c,v 1.12 2003/01/17 22:11:18 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: osf1_syscall.c,v 1.13 2003/10/27 07:07:35 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -263,7 +263,7 @@
        const struct sysent *callp;
        int error;
        u_int64_t rval[2];
-       u_int64_t *args, copyargs[10];                          /* XXX */
+       u_int64_t *args = NULL, copyargs[10];                   /* XXX */
        u_int hidden, nargs;
        struct proc *p = l->l_proc;
 
diff -r 07dc2918b477 -r 7dd4cff9eb91 sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c       Mon Oct 27 06:19:29 2003 +0000
+++ b/sys/arch/alpha/alpha/pmap.c       Mon Oct 27 07:07:34 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.203 2003/08/24 17:52:28 chs Exp $ */
+/* $NetBSD: pmap.c,v 1.204 2003/10/27 07:07:35 chs Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -145,7 +145,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.203 2003/08/24 17:52:28 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.204 2003/10/27 07:07:35 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2114,7 +2114,7 @@
 pmap_extract(pmap_t pmap, vaddr_t va, paddr_t *pap)
 {
        pt_entry_t *l1pte, *l2pte, *l3pte;
-       paddr_t pa;
+       paddr_t pa = 0;
        boolean_t rv = FALSE;
 
 #ifdef DEBUG
@@ -2316,6 +2316,7 @@
 #endif
 
        p0 = (u_long *)ALPHA_PHYS_TO_K0SEG(phys);
+       p1 = NULL;
        pend = (u_long *)((u_long)p0 + PAGE_SIZE);
 
        /*
diff -r 07dc2918b477 -r 7dd4cff9eb91 sys/arch/alpha/alpha/syscall.c
--- a/sys/arch/alpha/alpha/syscall.c    Mon Oct 27 06:19:29 2003 +0000
+++ b/sys/arch/alpha/alpha/syscall.c    Mon Oct 27 07:07:34 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: syscall.c,v 1.10 2003/08/24 16:36:10 chs Exp $ */
+/* $NetBSD: syscall.c,v 1.11 2003/10/27 07:07:35 chs Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.10 2003/08/24 16:36:10 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.11 2003/10/27 07:07:35 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -265,7 +265,7 @@
        const struct sysent *callp;
        int error;
        u_int64_t rval[2];
-       u_int64_t *args, copyargs[10];                          /* XXX */
+       u_int64_t *args = NULL, copyargs[10];                   /* XXX */
        u_int hidden, nargs;
        struct proc *p = l->l_proc;
 
diff -r 07dc2918b477 -r 7dd4cff9eb91 sys/arch/alpha/alpha/trap.c
--- a/sys/arch/alpha/alpha/trap.c       Mon Oct 27 06:19:29 2003 +0000
+++ b/sys/arch/alpha/alpha/trap.c       Mon Oct 27 07:07:34 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.86 2003/10/08 00:28:41 thorpej Exp $ */
+/* $NetBSD: trap.c,v 1.87 2003/10/27 07:07:35 chs Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.86 2003/10/08 00:28:41 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.87 2003/10/27 07:07:35 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -237,7 +237,7 @@
        struct lwp *l;
        struct proc *p;
        ksiginfo_t ksi;
-       vm_prot_t ftype;
+       vm_prot_t ftype = VM_PROT_NONE;
        u_int64_t ucode;
        int i, user;
 #if defined(DDB)
@@ -246,13 +246,13 @@
 
        l = curlwp;
 
-
-
        user = (framep->tf_regs[FRAME_PS] & ALPHA_PSL_USERMODE) != 0;
        if (user) {
                l->l_md.md_tf = framep;
                p = l->l_proc;
                (void)memset(&ksi, 0, sizeof(ksi));
+       } else {
+               p = NULL;
        }
 
        switch (entry) {
diff -r 07dc2918b477 -r 7dd4cff9eb91 sys/compat/linux/common/linux_exec_elf32.c
--- a/sys/compat/linux/common/linux_exec_elf32.c        Mon Oct 27 06:19:29 2003 +0000
+++ b/sys/compat/linux/common/linux_exec_elf32.c        Mon Oct 27 07:07:34 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_exec_elf32.c,v 1.64 2003/06/29 22:29:28 fvdl Exp $       */
+/*     $NetBSD: linux_exec_elf32.c,v 1.65 2003/10/27 07:07:34 chs Exp $        */
 
 /*-
  * Copyright (c) 1995, 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.64 2003/06/29 22:29:28 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.65 2003/10/27 07:07:34 chs Exp $");
 
 #ifndef ELFSIZE
 /* XXX should die */
@@ -108,10 +108,10 @@
        Elf_Ehdr *eh;
 {
        size_t shsize;
-       int     strndx;
+       int strndx;
        size_t i;
        static const char signature[] = "__libc_atexit";
-       char* strtable;
+       char *strtable = NULL;
        Elf_Shdr *sh;
        
        int error;
@@ -159,7 +159,8 @@
 
 out:
        free(sh, M_TEMP);
-       free(strtable, M_TEMP);
+       if (strtable)
+               free(strtable, M_TEMP);
        return (error);
 }
 #endif
diff -r 07dc2918b477 -r 7dd4cff9eb91 sys/compat/osf1/osf1_time.c
--- a/sys/compat/osf1/osf1_time.c       Mon Oct 27 06:19:29 2003 +0000
+++ b/sys/compat/osf1/osf1_time.c       Mon Oct 27 07:07:34 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_time.c,v 1.6 2003/01/18 08:32:05 thorpej Exp $ */
+/* $NetBSD: osf1_time.c,v 1.7 2003/10/27 07:07:34 chs Exp $ */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: osf1_time.c,v 1.6 2003/01/18 08:32:05 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: osf1_time.c,v 1.7 2003/10/27 07:07:34 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -194,6 +194,7 @@
        struct itimerval b_oitv;
        caddr_t sg;
        int error;
+
        switch (SCARG(uap, which)) {
        case OSF1_ITIMER_REAL:
                SCARG(&a, which) = ITIMER_REAL;
@@ -209,8 +210,7 @@
        }
        sg = stackgap_init(p, 0);
        SCARG(&a, itv) = stackgap_alloc(p, &sg, sizeof b_oitv);
-       if (error == 0)
-               error = sys_getitimer(l, &a, retval);
+       error = sys_getitimer(l, &a, retval);
        if (error == 0 && SCARG(uap, itv) != NULL) {
                /* get the NetBSD itimerval return value */
                error = copyin((caddr_t)SCARG(&a, itv), (caddr_t)&b_oitv,



Home | Main Index | Thread Index | Old Index