summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2020-11-17 16:38:11 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2020-11-17 16:38:11 +0000
commit7b664158ee91610dffefd9c018d68a311f386908 (patch)
treecee1c6fce7fb0b3a350e20a16f83cbd344e92317 /sys/arch
parent2c0851cc1e672d235c5cbe16f36bde8cb4020b86 (diff)
Avoid accidental truncation of large memory segments.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/loongson/loongson/machdep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c
index fc04f842f80..13475b282dc 100644
--- a/sys/arch/loongson/loongson/machdep.c
+++ b/sys/arch/loongson/loongson/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.92 2020/11/17 16:33:44 visa Exp $ */
+/* $OpenBSD: machdep.c,v 1.93 2020/11/17 16:38:10 visa Exp $ */
/*
* Copyright (c) 2009, 2010, 2014 Miodrag Vallat.
@@ -391,7 +391,7 @@ loongson_efi_setup(void)
entry.type != PMON_MEM_SYSTEM_HIGH))
continue;
fp = atop(entry.address);
- lp = atop(entry.address + (entry.size << 20));
+ lp = atop(entry.address + ((uint64_t)entry.size << 20));
if (lp > atop(pfn_to_pad(PG_FRAME)) + 1)
lp = atop(pfn_to_pad(PG_FRAME)) + 1;
if (fp >= lp)