diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2004-08-02 21:40:47 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2004-08-02 21:40:47 +0000 |
commit | 7a7900dc1da0e5483ce726b9dcda678eb64da36c (patch) | |
tree | 566e49035375dbff3e3c4dcefb4b3dc7edb8d18d | |
parent | 965e18722dbf9ccb41ad3d83beaa397d732300fb (diff) |
_bus_dmamap_load_mbuf: check and process pmap_extract failure.
From NetBSD
ok deraadt@
-rw-r--r-- | sys/arch/sparc64/sparc64/machdep.c | 14 |
1 files changed, 12 insertions, 2 deletions
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; |