diff options
author | 1996-01-13 03:12:12 +0000 | |
---|---|---|
committer | 1996-01-13 03:12:12 +0000 | |
commit | e9aa562604c86a9e35ca137dfcf81a9d413cc230 (patch) | |
tree | 3943188481e008bee5aab85e394723184585216a | |
parent | we no longer need to add in the offset to the mapped VA to get the correct (diff) | |
download | wireguard-openbsd-e9aa562604c86a9e35ca137dfcf81a9d413cc230.tar.xz wireguard-openbsd-e9aa562604c86a9e35ca137dfcf81a9d413cc230.zip |
have mapdev() panic if size == 0 to be safe (catches config errors)
-rw-r--r-- | sys/arch/sparc/sparc/machdep.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index b07e6110b47..9529ea31b0e 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -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 { |