summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/bt_subr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/sparc/dev/bt_subr.c')
-rw-r--r--sys/arch/sparc/dev/bt_subr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/sparc/dev/bt_subr.c b/sys/arch/sparc/dev/bt_subr.c
index 9a24467081b..224de260bfa 100644
--- a/sys/arch/sparc/dev/bt_subr.c
+++ b/sys/arch/sparc/dev/bt_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bt_subr.c,v 1.6 2001/11/06 19:53:16 miod Exp $ */
+/* $OpenBSD: bt_subr.c,v 1.7 2002/08/02 16:13:07 millert Exp $ */
/* $NetBSD: bt_subr.c,v 1.5 1996/03/14 19:44:32 christos Exp $ */
/*
@@ -77,7 +77,7 @@ bt_getcmap(p, cm, cmsize)
start = p->index;
count = p->count;
- if (start >= cmsize || start + count > cmsize)
+ if (start >= cmsize || count > cmsize - start)
return (EINVAL);
if (!uvm_useracc(p->red, count, B_WRITE) ||
!uvm_useracc(p->green, count, B_WRITE) ||
@@ -105,7 +105,7 @@ bt_putcmap(p, cm, cmsize)
start = p->index;
count = p->count;
- if (start >= cmsize || start + count > cmsize)
+ if (start >= cmsize || count > cmsize - start)
return (EINVAL);
if (!uvm_useracc(p->red, count, B_READ) ||
!uvm_useracc(p->green, count, B_READ) ||