summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-11-20 15:57:26 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-11-20 15:57:26 +0000
commitecd1eefababcba78141cf35e53ce1986f3041da8 (patch)
tree6a753b12df8dbc8d426b35ed136631986c0d11da /sys/dev
parent449e79b885b59db7893cf4f923168ccc0a9f7b8f (diff)
careful off handling in mmap routines
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/audio.c4
-rw-r--r--sys/dev/isa/isadma.c5
2 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c
index 5ee8c40519a..ae0a57a24ef 100644
--- a/sys/dev/audio.c
+++ b/sys/dev/audio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: audio.c,v 1.14 1998/11/03 21:00:09 downsj Exp $ */
+/* $OpenBSD: audio.c,v 1.15 1998/11/20 15:57:19 deraadt Exp $ */
/* $NetBSD: audio.c,v 1.105 1998/09/27 16:43:56 christos Exp $ */
/*
@@ -1659,7 +1659,7 @@ audio_mmap(dev, off, prot)
cb = &sc->sc_pr;
#endif
- if (off >= cb->bufsize)
+ if ((u_int)off >= cb->bufsize)
return -1;
if (!cb->mmapped) {
cb->mmapped = 1;
diff --git a/sys/dev/isa/isadma.c b/sys/dev/isa/isadma.c
index 2a07a876042..3fab93036c8 100644
--- a/sys/dev/isa/isadma.c
+++ b/sys/dev/isa/isadma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isadma.c,v 1.19 1998/03/02 07:02:08 todd Exp $ */
+/* $OpenBSD: isadma.c,v 1.20 1998/11/20 15:57:20 deraadt Exp $ */
/* $NetBSD: isadma.c,v 1.32 1997/09/05 01:48:33 thorpej Exp $ */
/*-
@@ -584,6 +584,9 @@ isa_dmamem_free(isadev, chan, addr, size)
panic("isa_dmamem_free");
}
+ if (off < 0)
+ return (-1);
+
seg.ds_addr = addr;
seg.ds_len = size;