summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2011-05-01 07:01:37 +0000
committermiod <miod@openbsd.org>2011-05-01 07:01:37 +0000
commit2bbfad7cd0c9095055649c614b1dad4aeed209a0 (patch)
tree131fb1bd53b7646284f3bf9241895a6a2b0fe625
parentPull in <string.h> for memset() (diff)
downloadwireguard-openbsd-2bbfad7cd0c9095055649c614b1dad4aeed209a0.tar.xz
wireguard-openbsd-2bbfad7cd0c9095055649c614b1dad4aeed209a0.zip
Be sure to cast physmem to a 64-bit type before passing it to ptoa().
-rw-r--r--sys/arch/mips64/mips64/mem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/mips64/mips64/mem.c b/sys/arch/mips64/mips64/mem.c
index cbb567c5bfc..3de987bc7c8 100644
--- a/sys/arch/mips64/mips64/mem.c
+++ b/sys/arch/mips64/mips64/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.16 2010/06/26 23:24:43 guenther Exp $ */
+/* $OpenBSD: mem.c,v 1.17 2011/05/01 07:01:37 miod Exp $ */
/* $NetBSD: mem.c,v 1.6 1995/04/10 11:55:03 mycroft Exp $ */
/*
@@ -115,7 +115,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
case 0:
v = uio->uio_offset;
c = iov->iov_len;
- if (v + c > ptoa(physmem))
+ if (v + c > ptoa((psize_t)physmem))
return (EFAULT);
v = (vaddr_t)PHYS_TO_XKPHYS(v, CCA_NONCOHERENT);
error = uiomove((caddr_t)v, c, uio);