From 7a7900dc1da0e5483ce726b9dcda678eb64da36c Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Mon, 2 Aug 2004 21:40:47 +0000 Subject: _bus_dmamap_load_mbuf: check and process pmap_extract failure. From NetBSD ok deraadt@ --- sys/arch/sparc64/sparc64/machdep.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sys/arch') diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index 81a8228d8c2..8fa324c10a9 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.69 2004/06/28 01:47:41 aaron Exp $ */ +/* $OpenBSD: machdep.c,v 1.70 2004/08/02 21:40:46 brad Exp $ */ /* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */ /*- @@ -1285,7 +1285,17 @@ _bus_dmamap_load_mbuf(t, t0, map, m, flags) long incr; incr = min(buflen, NBPG); - (void) pmap_extract(pmap_kernel(), vaddr, &pa); + + if (pmap_extract(pmap_kernel(), vaddr, &pa) == FALSE) { +#ifdef DIAGNOSTIC + printf("_bus_dmamap_load_mbuf: pmap_extract failed %lx\n", + vaddr); + map->_dm_type = 0; + map->_dm_source = NULL; +#endif + return EINVAL; + } + buflen -= incr; vaddr += incr; -- cgit v1.2.3