summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2016-12-20 13:47:38 +0000
committerjsg <jsg@openbsd.org>2016-12-20 13:47:38 +0000
commitcae4b573530fb955618c1e2f47a7bd5fcde6de9c (patch)
tree2b8675e85fd8ef42a1f8f197a45a201786ceb4a3
parentno need to test if an array is non-NULL (diff)
downloadwireguard-openbsd-cae4b573530fb955618c1e2f47a7bd5fcde6de9c.tar.xz
wireguard-openbsd-cae4b573530fb955618c1e2f47a7bd5fcde6de9c.zip
fix use of uninitialised variables
ok kettenis@
-rw-r--r--sys/arch/sparc64/dev/uperf.c4
-rw-r--r--sys/arch/sparc64/sparc64/trap.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/sys/arch/sparc64/dev/uperf.c b/sys/arch/sparc64/dev/uperf.c
index 5a079862d61..d8188c96018 100644
--- a/sys/arch/sparc64/dev/uperf.c
+++ b/sys/arch/sparc64/dev/uperf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uperf.c,v 1.6 2011/04/07 15:30:16 miod Exp $ */
+/* $OpenBSD: uperf.c,v 1.7 2016/12/20 13:47:38 jsg Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -167,6 +167,8 @@ uperf_setcntsrc(usc, io)
u_int32_t cnt0_src, cnt1_src;
int error;
+ cnt0_src = cnt1_src = 0;
+
if (io->cnt_flags & UPERF_CNT0) {
error = uperf_findbysrc(usc, UPERF_CNT0,
io->cnt_src0, &cnt0_src);
diff --git a/sys/arch/sparc64/sparc64/trap.c b/sys/arch/sparc64/sparc64/trap.c
index c4d460e3536..107831b43cc 100644
--- a/sys/arch/sparc64/sparc64/trap.c
+++ b/sys/arch/sparc64/sparc64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.95 2016/10/18 00:43:57 guenther Exp $ */
+/* $OpenBSD: trap.c,v 1.96 2016/12/20 13:47:38 jsg Exp $ */
/* $NetBSD: trap.c,v 1.73 2001/08/09 01:03:01 eeh Exp $ */
/*
@@ -904,6 +904,8 @@ data_access_error(struct trapframe64 *tf, unsigned type, vaddr_t afva,
if ((p = curproc) == NULL) /* safety check */
p = &proc0;
+ tstate = tf->tf_tstate;
+
/*
* Catch PCI config space reads.
*/
@@ -913,7 +915,6 @@ data_access_error(struct trapframe64 *tf, unsigned type, vaddr_t afva,
}
pc = tf->tf_pc;
- tstate = tf->tf_tstate;
sv.sival_ptr = (void *)pc;
@@ -1149,7 +1150,7 @@ syscall(struct trapframe64 *tf, register_t code, register_t pc)
int i, nsys, nap;
int64_t *ap;
const struct sysent *callp;
- struct proc *p;
+ struct proc *p = curproc;
int error, new;
register_t args[8];
register_t rval[2];
@@ -1158,7 +1159,6 @@ syscall(struct trapframe64 *tf, register_t code, register_t pc)
sigexit(p, SIGILL);
uvmexp.syscalls++;
- p = curproc;
#ifdef DIAGNOSTIC
if (tf->tf_tstate & TSTATE_PRIV)
panic("syscall from kernel");