summaryrefslogtreecommitdiff
path: root/sys/arch/sh
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-10-04 19:21:51 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-10-04 19:21:51 +0000
commitf305bf8af77999ee7824f7f4c96e43490eba80ae (patch)
treed26c2edefabf557345d6b627963892be906cdb44 /sys/arch/sh
parentb5d1ec4d7eeeea83da2a948843584c874150a3f6 (diff)
Fix potentially uninitialized variables in syscall().
Diffstat (limited to 'sys/arch/sh')
-rw-r--r--sys/arch/sh/sh/trap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/arch/sh/sh/trap.c b/sys/arch/sh/sh/trap.c
index beb89c031ee..24e3dd76e04 100644
--- a/sys/arch/sh/sh/trap.c
+++ b/sys/arch/sh/sh/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.13 2008/06/24 21:24:03 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.14 2008/10/04 19:21:50 miod Exp $ */
/* $NetBSD: exception.c,v 1.32 2006/09/04 23:57:52 uwe Exp $ */
/* $NetBSD: syscall.c,v 1.6 2006/03/07 07:21:50 thorpej Exp $ */
@@ -571,7 +571,7 @@ syscall(struct proc *p, struct trapframe *tf)
#ifdef DIAGNOSTIC
if (argsize > sizeof args) {
callp += p->p_emul->e_nosys - code;
- goto bad;
+ argsize = callp->sy_argsize;
}
#endif
@@ -620,9 +620,6 @@ syscall(struct proc *p, struct trapframe *tf)
break;
}
- if (error)
- goto bad;
-
#ifdef SYSCALL_DEBUG
scdebug_call(p, code, args);
#endif
@@ -631,6 +628,9 @@ syscall(struct proc *p, struct trapframe *tf)
ktrsyscall(p, code, callp->sy_argsize, args);
#endif
+ if (error != 0)
+ goto bad;
+
rval[0] = 0;
rval[1] = tf->tf_r1;
#if NSYSTRACE > 0
@@ -640,6 +640,7 @@ syscall(struct proc *p, struct trapframe *tf)
#endif
error = (*callp->sy_call)(p, args, rval);
+bad:
switch (oerror = error) {
case 0:
tf->tf_r0 = rval[0];
@@ -654,7 +655,6 @@ syscall(struct proc *p, struct trapframe *tf)
/* nothing to do */
break;
default:
-bad:
if (p->p_emul->e_errno)
error = p->p_emul->e_errno[error];
tf->tf_r0 = error;