Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64/sparc64 Fix kmem_free() size mismatch



details:   https://anonhg.NetBSD.org/src/rev/1e7bd52102f5
branches:  trunk
changeset: 811601:1e7bd52102f5
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Nov 07 11:47:09 2015 +0000

description:
Fix kmem_free() size mismatch

diffstat:

 sys/arch/sparc64/sparc64/netbsd32_machdep.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 272dc0e36fd6 -r 1e7bd52102f5 sys/arch/sparc64/sparc64/netbsd32_machdep.c
--- a/sys/arch/sparc64/sparc64/netbsd32_machdep.c       Sat Nov 07 03:06:32 2015 +0000
+++ b/sys/arch/sparc64/sparc64/netbsd32_machdep.c       Sat Nov 07 11:47:09 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.104 2015/10/31 02:36:17 nakayama Exp $  */
+/*     $NetBSD: netbsd32_machdep.c,v 1.105 2015/11/07 11:47:09 martin Exp $    */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.104 2015/10/31 02:36:17 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.105 2015/11/07 11:47:09 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1324,7 +1324,8 @@
        error = cpu_setmcontext32(l, &uc->uc_mcontext, uc->uc_flags);
        KASSERT(error == 0);
 
-       kmem_free(uc, sizeof(ucontext32_t));
+       /* Note: we are freeing ucontext_t, not ucontext32_t. */
+       kmem_free(arg, sizeof(ucontext_t));
        userret(l, 0, 0);
 }
 



Home | Main Index | Thread Index | Old Index