Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/arm32 Fix off by one in _bus_dma_{paddr_inrange...
details: https://anonhg.NetBSD.org/src/rev/bc1229093fb7
branches: trunk
changeset: 327058:bc1229093fb7
user: skrll <skrll%NetBSD.org@localhost>
date: Wed Feb 26 07:57:09 2014 +0000
description:
Fix off by one in _bus_dma_{paddr_inrange,_to_paddr} when checking the
dma range.
diffstat:
sys/arch/arm/arm32/bus_dma.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (36 lines):
diff -r b99f08abc267 -r bc1229093fb7 sys/arch/arm/arm32/bus_dma.c
--- a/sys/arch/arm/arm32/bus_dma.c Wed Feb 26 07:48:29 2014 +0000
+++ b/sys/arch/arm/arm32/bus_dma.c Wed Feb 26 07:57:09 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma.c,v 1.81 2014/02/26 01:05:52 matt Exp $ */
+/* $NetBSD: bus_dma.c,v 1.82 2014/02/26 07:57:09 skrll Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#include "opt_arm_bus_space.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.81 2014/02/26 01:05:52 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.82 2014/02/26 07:57:09 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -139,7 +139,7 @@
for (i = 0, dr = ranges; i < nranges; i++, dr++) {
if (curaddr >= dr->dr_sysbase &&
- round_page(curaddr) <= (dr->dr_sysbase + dr->dr_len))
+ curaddr < (dr->dr_sysbase + dr->dr_len))
return (dr);
}
@@ -160,7 +160,7 @@
for (i = 0, dr = t->_ranges; i < t->_nranges; i++, dr++) {
if (dr->dr_busbase <= curaddr
- && round_page(curaddr) <= dr->dr_busbase + dr->dr_len)
+ && curaddr < dr->dr_busbase + dr->dr_len)
return curaddr - dr->dr_busbase + dr->dr_sysbase;
}
panic("%s: curaddr %#lx not in range", __func__, curaddr);
Home |
Main Index |
Thread Index |
Old Index