Module Name: src Committed By: mrg Date: Tue Jan 7 07:26:21 UTC 2020
Modified Files: src/sys/compat/netbsd32: netbsd32_vm.c Log Message: don't check the value of retval in netbsd32_mmap() if sys_mmap() was not successful. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_vm.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/compat/netbsd32/netbsd32_vm.c diff -u src/sys/compat/netbsd32/netbsd32_vm.c:1.1 src/sys/compat/netbsd32/netbsd32_vm.c:1.2 --- src/sys/compat/netbsd32/netbsd32_vm.c:1.1 Mon Dec 24 21:27:06 2018 +++ src/sys/compat/netbsd32/netbsd32_vm.c Tue Jan 7 07:26:21 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_vm.c,v 1.1 2018/12/24 21:27:06 mrg Exp $ */ +/* $NetBSD: netbsd32_vm.c,v 1.2 2020/01/07 07:26:21 mrg Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_vm.c,v 1.1 2018/12/24 21:27:06 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_vm.c,v 1.2 2020/01/07 07:26:21 mrg Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -86,9 +86,13 @@ netbsd32_mmap(struct lwp *l, const struc #endif error = sys_mmap(l, &ua, retval); - if ((u_long)*retval > (u_long)UINT_MAX) { - printf("netbsd32_mmap: retval out of range: 0x%lx\n", - (u_long)*retval); + if (error == 0 && (u_long)*retval > (u_long)UINT_MAX) { + const char *name = curlwp->l_name; + + if (name == NULL) + name = curproc->p_comm; + printf("netbsd32_mmap(%s:%u:%u): retval out of range: 0x%lx\n", + name, curproc->p_pid, curlwp->l_lid, (u_long)*retval); /* Should try to recover and return an error here. */ } return error;