summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>1999-02-13 09:58:39 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>1999-02-13 09:58:39 +0000
commit5b6ed6e28780ec0ed734912f0c51a140e768062b (patch)
treebcd0506c79648f9106effab6eccc35d3bea5756f /sys/dev/ic
parent3108c2f0c2ef51bddd0406bc2dfd39c4f162de42 (diff)
Always check that "range->start" and "range->len" is within the bounds of
"h->sc->iobase" and "h->sc->iosize" before call bus_space_alloc.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/i82365.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/ic/i82365.c b/sys/dev/ic/i82365.c
index cc13702cae5..1e4db8972a2 100644
--- a/sys/dev/ic/i82365.c
+++ b/sys/dev/ic/i82365.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i82365.c,v 1.5 1999/02/06 17:01:17 fgsch Exp $ */
+/* $OpenBSD: i82365.c,v 1.6 1999/02/13 09:58:38 fgsch Exp $ */
/* $NetBSD: i82365.c,v 1.10 1998/06/09 07:36:55 thorpej Exp $ */
/*
@@ -836,7 +836,7 @@ pcic_chip_io_alloc(pch, start, size, align, pcihp)
struct pcic_handle *h = (struct pcic_handle *) pch;
bus_space_tag_t iot;
bus_space_handle_t ioh;
- bus_addr_t ioaddr = 0, beg, fin;
+ bus_addr_t ioaddr, beg, fin;
int flags = 0;
struct pcic_ranges *range;
@@ -875,8 +875,8 @@ pcic_chip_io_alloc(pch, start, size, align, pcihp)
fin = min(range->start + range->len,
h->sc->iobase + h->sc->iosize);
- /* Short-circuit easy case. */
- if (fin - beg < size)
+ /* Short-circuit easy cases. */
+ if (fin < beg || fin - beg < size)
continue;
/*