summaryrefslogtreecommitdiff
path: root/sys/arch/loongson
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2017-05-09 15:20:56 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2017-05-09 15:20:56 +0000
commit7acbb565dc80cd254ef446d4478a069d08d85d42 (patch)
treef41636094f1c135eb66d36b01394d287d94ed5c4 /sys/arch/loongson
parent88325a8b3205f45505cd1807533ed9c67a4e2493 (diff)
Fix range check.
Diffstat (limited to 'sys/arch/loongson')
-rw-r--r--sys/arch/loongson/dev/htb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/loongson/dev/htb.c b/sys/arch/loongson/dev/htb.c
index 2dd3057bee5..6cc2f64a2ef 100644
--- a/sys/arch/loongson/dev/htb.c
+++ b/sys/arch/loongson/dev/htb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: htb.c,v 1.1 2016/11/17 14:41:21 visa Exp $ */
+/* $OpenBSD: htb.c,v 1.2 2017/05/09 15:20:55 visa Exp $ */
/*
* Copyright (c) 2016 Visa Hankala
@@ -393,7 +393,7 @@ int
htb_mem_map(bus_space_tag_t t, bus_addr_t offs, bus_size_t size, int flags,
bus_space_handle_t *bshp)
{
- if (offs < HTB_MEM_BASE || offs >= HTB_MEM_BASE + HTB_MEM_SIZE)
+ if (offs < HTB_MEM_BASE || offs + size > HTB_MEM_BASE + HTB_MEM_SIZE)
return EINVAL;
*bshp = t->bus_base + offs;