From: Kees van Reeuwijk Date: Fri, 19 Feb 2010 10:41:02 +0000 (+0000) Subject: Fix some uses of uninitialized variables. X-Git-Tag: v3.1.7~279 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/index.html?a=commitdiff_plain;h=1ba0936619d5ec05f046c655197a56ff9fdbe67a;p=minix.git Fix some uses of uninitialized variables. --- diff --git a/commands/elle/sberr.c b/commands/elle/sberr.c index c707532b6..168727f4e 100644 --- a/commands/elle/sberr.c +++ b/commands/elle/sberr.c @@ -149,7 +149,7 @@ char * sbe_mlst(p) int p; { register struct smblk *sm, *smf, *smb; - char *nextaddr; + char *nextaddr = NULL; int i; struct ptab smtab; /* For loop detection */ diff --git a/drivers/orinoco/orinoco.c b/drivers/orinoco/orinoco.c index 34257ad49..b216756bb 100644 --- a/drivers/orinoco/orinoco.c +++ b/drivers/orinoco/orinoco.c @@ -1402,6 +1402,9 @@ static void or_writev (message * mp, int from_int, int vectored) { assert (orp->or_mode == OR_M_ENABLED); assert (orp->or_flags & OR_F_ENABLED); + /* CvR: copied from or_writev_s(), since txfid was not initialized. */ + txfid = orp->or_tx.or_txfid; + if (vectored) { int iov_offset = 0; diff --git a/drivers/rtl8139/rtl8139.c b/drivers/rtl8139/rtl8139.c index ccad80543..06bd9204b 100644 --- a/drivers/rtl8139/rtl8139.c +++ b/drivers/rtl8139/rtl8139.c @@ -720,7 +720,7 @@ re_t *rep; #define BUF_ALIGNMENT (64*1024) if(!(mallocbuf = alloc_contig(BUF_ALIGNMENT + tot_bufsize, 0, &buf))) { - panic("RTL8139","Couldn't allocate kernel buffer",i); + panic("RTL8139","Couldn't allocate kernel buffer",NO_NUM); } /* click-align mallocced buffer. this is what we used to get diff --git a/kernel/arch/i386/memory.c b/kernel/arch/i386/memory.c index 83e7fc638..19bfb8d09 100644 --- a/kernel/arch/i386/memory.c +++ b/kernel/arch/i386/memory.c @@ -502,7 +502,8 @@ PUBLIC int vm_lookup(struct proc *proc, vir_bytes virtual, vir_bytes *physical, PUBLIC int vm_contiguous(struct proc *targetproc, u32_t vir_buf, size_t bytes) { int first = 1, r; - u32_t prev_phys, po; + u32_t prev_phys = 0; /* Keep lints happy. */ + u32_t po; vmassert(targetproc); vmassert(bytes > 0); diff --git a/kernel/proc.c b/kernel/proc.c index 84a4ed877..612736b7b 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -1221,7 +1221,7 @@ register struct proc *rp; /* this process is now runnable */ */ PRIVATE void enqueue_head(struct proc *rp) { - int q; /* scheduling queue to use */ + int q = rp->p_priority; /* scheduling queue to use */ #if DEBUG_SCHED_CHECK if (rp->p_ready) minix_panic("enqueue already ready process", NO_NUM); @@ -1235,7 +1235,6 @@ PRIVATE void enqueue_head(struct proc *rp) vmassert(q >= 0); - q = rp->p_priority; /* Now add the process to the queue. */ if (rdy_head[q] == NIL_PROC) { /* add to empty queue */