uninitialized variables

This commit is contained in:
chs 2003-10-27 07:07:34 +00:00
parent 7568eb663a
commit 3b6d3c710c
19 changed files with 71 additions and 65 deletions

View File

@ -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 @@ recognized:
static void
cpu_announce_extensions(struct cpu_info *ci)
{
u_long implver, amask;
u_long implver, amask = 0;
char bits[64];
implver = alpha_implver();

View File

@ -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 @@ db_stack_trace_print(db_expr_t addr, boolean_t have_addr, db_expr_t count,
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 @@ db_stack_trace_print(db_expr_t addr, boolean_t have_addr, db_expr_t count,
return;
}
frame = addr;
tf = NULL;
}
ra_from_tf = FALSE;
while (count--) {
if (have_trapframe) {

View File

@ -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 @@ linux_syscall_fancy(struct lwp *l, u_int64_t code, struct trapframe *framep)
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;

View File

@ -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 @@ osf1_syscall_fancy(struct lwp *l, u_int64_t code, struct trapframe *framep)
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;

View File

@ -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 @@ boolean_t
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 @@ pmap_zero_page(paddr_t phys)
#endif
p0 = (u_long *)ALPHA_PHYS_TO_K0SEG(phys);
p1 = NULL;
pend = (u_long *)((u_long)p0 + PAGE_SIZE);
/*

View File

@ -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 @@ syscall_fancy(struct lwp *l, u_int64_t code, struct trapframe *framep)
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;

View File

@ -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 @@ trap(const u_long a0, const u_long a1, const u_long a2, const u_long entry,
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 @@ trap(const u_long a0, const u_long a1, const u_long a2, const u_long entry,
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) {

View File

@ -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 @@ ELFNAME2(linux,atexit_signature)(p, epp, eh)
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 @@ ELFNAME2(linux,atexit_signature)(p, epp, eh)
out:
free(sh, M_TEMP);
free(strtable, M_TEMP);
if (strtable)
free(strtable, M_TEMP);
return (error);
}
#endif

View File

@ -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 @@ osf1_sys_getitimer(l, v, retval)
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 @@ osf1_sys_getitimer(l, v, retval)
}
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,
@ -242,7 +242,7 @@ osf1_sys_settimeofday(l, v, retval)
struct osf1_timezone otz;
struct timeval tv;
struct timezone tz;
int error;
int error = 0;
caddr_t sg;
sg = stackgap_init(p, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: cz.c,v 1.28 2003/06/29 22:30:24 fvdl Exp $ */
/* $NetBSD: cz.c,v 1.29 2003/10/27 07:07:34 chs Exp $ */
/*-
* Copyright (c) 2000 Zembu Labs, Inc.
@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.28 2003/06/29 22:30:24 fvdl Exp $");
__KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.29 2003/10/27 07:07:34 chs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -875,8 +875,8 @@ cz_wait_pci_doorbell(struct cz_softc *cz, const char *wstring)
struct cztty_softc *
cztty_getttysoftc(dev_t dev)
{
int i, j, k, u = minor(dev) & ~CZTTYDIALOUT_MASK;
struct cz_softc *cz;
int i, j, k = 0, u = minor(dev) & ~CZTTYDIALOUT_MASK;
struct cz_softc *cz = NULL;
for (i = 0, j = 0; i < cz_cd.cd_ndevs; i++) {
k = j;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tga.c,v 1.53 2003/10/21 16:17:18 tsutsui Exp $ */
/* $NetBSD: tga.c,v 1.54 2003/10/27 07:07:34 chs Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tga.c,v 1.53 2003/10/21 16:17:18 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: tga.c,v 1.54 2003/10/27 07:07:34 chs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1049,7 +1049,7 @@ tga_rop_vtov(dst, dx, dy, w, h, rop, src, sx, sy)
int x, y, wb;
int xstart, xend, xdir;
int ystart, yend, ydir, yinc;
int xleft, lastx, lastleft;
int xleft, lastx = 0, lastleft = 0;
int offset = 1 * dc->dc_tgaconf->tgac_vvbr_units;
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ray.c,v 1.41 2003/10/25 21:30:03 christos Exp $ */
/* $NetBSD: if_ray.c,v 1.42 2003/10/27 07:07:34 chs Exp $ */
/*
* Copyright (c) 2000 Christian E. Hopps
* All rights reserved.
@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.41 2003/10/25 21:30:03 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.42 2003/10/27 07:07:34 chs Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -1853,8 +1853,8 @@ ray_check_ccs(arg)
{
ray_cmd_func_t fp;
struct ray_softc *sc;
u_int i, cmd, stat;
bus_size_t ccs;
u_int i, cmd, stat = 0;
bus_size_t ccs = 0;
int s;
s = splnet();

View File

@ -1,4 +1,4 @@
/* $NetBSD: cfb.c,v 1.40 2003/06/29 22:30:51 fvdl Exp $ */
/* $NetBSD: cfb.c,v 1.41 2003/10/27 07:07:35 chs Exp $ */
/*
* Copyright (c) 1998, 1999 Tohru Nishimura. All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cfb.c,v 1.40 2003/06/29 22:30:51 fvdl Exp $");
__KERNEL_RCSID(0, "$NetBSD: cfb.c,v 1.41 2003/10/27 07:07:35 chs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -714,7 +714,7 @@ set_cursor(sc, p)
struct wsdisplay_cursor *p;
{
#define cc (&sc->sc_cursor)
u_int v, index, count, icount;
u_int v, index = 0, count = 0, icount = 0;
v = p->which;
if (v & WSDISPLAY_CURSOR_DOCMAP) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: mfb.c,v 1.37 2003/06/29 22:30:52 fvdl Exp $ */
/* $NetBSD: mfb.c,v 1.38 2003/10/27 07:07:35 chs Exp $ */
/*
* Copyright (c) 1998, 1999 Tohru Nishimura. All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mfb.c,v 1.37 2003/06/29 22:30:52 fvdl Exp $");
__KERNEL_RCSID(0, "$NetBSD: mfb.c,v 1.38 2003/10/27 07:07:35 chs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -625,7 +625,7 @@ set_cursor(sc, p)
struct wsdisplay_cursor *p;
{
#define cc (&sc->sc_cursor)
u_int v, count, index;
u_int v, count = 0, index = 0;
v = p->which;
if (v & WSDISPLAY_CURSOR_DOCMAP) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: px.c,v 1.20 2003/10/23 23:25:39 mycroft Exp $ */
/* $NetBSD: px.c,v 1.21 2003/10/27 07:07:35 chs Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: px.c,v 1.20 2003/10/23 23:25:39 mycroft Exp $");
__KERNEL_RCSID(0, "$NetBSD: px.c,v 1.21 2003/10/27 07:07:35 chs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -188,6 +188,8 @@ px_init(struct stic_info *si, int bootstrap)
caddr_t kva, bva;
paddr_t bpa;
kva = (caddr_t)si->si_slotbase;
/*
* Allocate memory for the packet buffers. It must be located below
* 8MB, since the STIC can't access outside that region. Also, due
@ -211,8 +213,6 @@ px_init(struct stic_info *si, int bootstrap)
bpa = TAILQ_FIRST(&pglist)->phys_addr;
}
kva = (caddr_t)si->si_slotbase;
si->si_vdac = (u_int32_t *)(kva + PX_VDAC_OFFSET);
si->si_vdac_reset = (u_int32_t *)(kva + PX_VDAC_RESET_OFFSET);
si->si_stic = (volatile struct stic_regs *)(kva + PX_STIC_OFFSET);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pxg.c,v 1.16 2003/10/23 23:52:16 mycroft Exp $ */
/* $NetBSD: pxg.c,v 1.17 2003/10/27 07:07:35 chs Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pxg.c,v 1.16 2003/10/23 23:52:16 mycroft Exp $");
__KERNEL_RCSID(0, "$NetBSD: pxg.c,v 1.17 2003/10/27 07:07:35 chs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -360,7 +360,7 @@ pxg_ioctl(struct stic_info *si, u_long cmd, caddr_t data, int flag,
struct proc *p)
{
struct stic_xinfo *sxi;
volatile u_int32_t *ptr;
volatile u_int32_t *ptr = NULL;
int rv, s;
switch (cmd) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: sfb.c,v 1.59 2003/06/29 22:30:53 fvdl Exp $ */
/* $NetBSD: sfb.c,v 1.60 2003/10/27 07:07:35 chs Exp $ */
/*
* Copyright (c) 1998, 1999 Tohru Nishimura. All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sfb.c,v 1.59 2003/06/29 22:30:53 fvdl Exp $");
__KERNEL_RCSID(0, "$NetBSD: sfb.c,v 1.60 2003/10/27 07:07:35 chs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -744,7 +744,7 @@ set_cursor(sc, p)
struct wsdisplay_cursor *p;
{
#define cc (&sc->sc_cursor)
u_int v, index, count, icount;
u_int v, index = 0, count = 0, icount = 0;
v = p->which;
if (v & WSDISPLAY_CURSOR_DOCMAP) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: stic.c,v 1.24 2003/06/29 22:30:54 fvdl Exp $ */
/* $NetBSD: stic.c,v 1.25 2003/10/27 07:07:35 chs Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: stic.c,v 1.24 2003/06/29 22:30:54 fvdl Exp $");
__KERNEL_RCSID(0, "$NetBSD: stic.c,v 1.25 2003/10/27 07:07:35 chs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1314,7 +1314,7 @@ int
stic_set_cursor(struct stic_info *si, struct wsdisplay_cursor *p)
{
#define cc (&si->si_cursor)
u_int v, index, count, icount;
u_int v, index = 0, count = 0, icount = 0;
struct stic_screen *ss;
int s;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tfb.c,v 1.40 2003/06/29 22:30:55 fvdl Exp $ */
/* $NetBSD: tfb.c,v 1.41 2003/10/27 07:07:35 chs Exp $ */
/*
* Copyright (c) 1998, 1999 Tohru Nishimura. All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tfb.c,v 1.40 2003/06/29 22:30:55 fvdl Exp $");
__KERNEL_RCSID(0, "$NetBSD: tfb.c,v 1.41 2003/10/27 07:07:35 chs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -796,7 +796,7 @@ set_cursor(sc, p)
struct wsdisplay_cursor *p;
{
#define cc (&sc->sc_cursor)
u_int v, index, count, icount;
u_int v, index = 0, count = 0, icount = 0;
v = p->which;
if (v & WSDISPLAY_CURSOR_DOCMAP) {