summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mvme68k/dev/nvram.c4
-rw-r--r--sys/arch/mvme68k/dev/sram.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/mvme68k/dev/nvram.c b/sys/arch/mvme68k/dev/nvram.c
index 2cae7e8cdf4..de60a8e32de 100644
--- a/sys/arch/mvme68k/dev/nvram.c
+++ b/sys/arch/mvme68k/dev/nvram.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nvram.c,v 1.13 2004/07/02 17:37:16 miod Exp $ */
+/* $OpenBSD: nvram.c,v 1.14 2004/07/02 18:00:50 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -415,7 +415,7 @@ nvrammmap(dev, off, prot)
return (-1);
/* allow access only in RAM */
- if (off > sc->sc_len)
+ if (off < 0 || off > sc->sc_len)
return (-1);
return (m68k_btop(sc->sc_paddr + off));
}
diff --git a/sys/arch/mvme68k/dev/sram.c b/sys/arch/mvme68k/dev/sram.c
index f5b6fe70650..6008c82b6e7 100644
--- a/sys/arch/mvme68k/dev/sram.c
+++ b/sys/arch/mvme68k/dev/sram.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sram.c,v 1.13 2004/07/02 17:37:16 miod Exp $ */
+/* $OpenBSD: sram.c,v 1.14 2004/07/02 18:00:50 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -216,7 +216,7 @@ srammmap(dev, off, prot)
return (-1);
/* allow access only in RAM */
- if (off > sc->sc_len)
+ if (off < 0 || off > sc->sc_len)
return (-1);
return (m68k_btop(sc->sc_paddr + off));
}