have mapdev() panic if size == 0 to be safe (catches config errors)
authorchuck <chuck@openbsd.org>
Sat, 13 Jan 1996 03:12:12 +0000 (03:12 +0000)
committerchuck <chuck@openbsd.org>
Sat, 13 Jan 1996 03:12:12 +0000 (03:12 +0000)
sys/arch/sparc/sparc/machdep.c

index b07e611..9529ea3 100644 (file)
@@ -873,6 +873,8 @@ mapdev(rr, virt, offset, size, bustype)
                iobase = IODEV_BASE;
 
        size = round_page(size);
+       if (size == 0) panic("mapdev: zero size");
+
        if (virt)
                v = trunc_page(virt);
        else {