Module Name:    src
Committed By:   bouyer
Date:           Sun Nov 15 20:57:03 UTC 2015

Modified Files:
        src/sys/arch/x86/x86 [netbsd-6]: sys_machdep.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1341):
        sys/arch/x86/x86/sys_machdep.c: revision 1.29
fix broken error handling; error was used uninitialized. Changing the
compilation flags broke all threaded programs for me.
XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.8.1 src/sys/arch/x86/x86/sys_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/sys_machdep.c
diff -u src/sys/arch/x86/x86/sys_machdep.c:1.25 src/sys/arch/x86/x86/sys_machdep.c:1.25.8.1
--- src/sys/arch/x86/x86/sys_machdep.c:1.25	Mon Oct 10 15:15:28 2011
+++ src/sys/arch/x86/x86/sys_machdep.c	Sun Nov 15 20:57:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_machdep.c,v 1.25 2011/10/10 15:15:28 jakllsch Exp $	*/
+/*	$NetBSD: sys_machdep.c,v 1.25.8.1 2015/11/15 20:57:03 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.25 2011/10/10 15:15:28 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.25.8.1 2015/11/15 20:57:03 bouyer Exp $");
 
 #include "opt_mtrr.h"
 #include "opt_perfctrs.h"
@@ -657,7 +657,6 @@ x86_set_sdbase(void *arg, char which, lw
 #else
 	struct pcb *pcb;
 	vaddr_t base;
-	int error;
 
 	if (l->l_proc->p_flag & PK_32) {
 		return x86_set_sdbase32(arg, which, l, direct);
@@ -666,7 +665,7 @@ x86_set_sdbase(void *arg, char which, lw
 	if (direct) {
 		base = (vaddr_t)arg;
 	} else {
-		error = copyin(arg, &base, sizeof(base));
+		int error = copyin(arg, &base, sizeof(base));
 		if (error != 0)
 			return error;
 	}
@@ -674,10 +673,6 @@ x86_set_sdbase(void *arg, char which, lw
 	if (base >= VM_MAXUSER_ADDRESS)
 		return EINVAL;
 
-	if (error) {
-		return error;
-	}
-
 	pcb = lwp_getpcb(l);
 
 	kpreempt_disable();
@@ -697,7 +692,7 @@ x86_set_sdbase(void *arg, char which, lw
 	}
 	kpreempt_enable();
 
-	return error;
+	return 0;
 #endif
 }
 

Reply via email to