Module Name: src Committed By: skrll Date: Fri Feb 12 22:23:40 UTC 2010
Modified Files: src/sys/arch/hp700/hp700: mainbus.c Log Message: Just return if length of zero is passed to bus_dmamap_sync. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/arch/hp700/hp700/mainbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/hp700/hp700/mainbus.c diff -u src/sys/arch/hp700/hp700/mainbus.c:1.58 src/sys/arch/hp700/hp700/mainbus.c:1.59 --- src/sys/arch/hp700/hp700/mainbus.c:1.58 Wed Dec 2 13:49:32 2009 +++ src/sys/arch/hp700/hp700/mainbus.c Fri Feb 12 22:23:40 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.58 2009/12/02 13:49:32 skrll Exp $ */ +/* $NetBSD: mainbus.c,v 1.59 2010/02/12 22:23:40 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.58 2009/12/02 13:49:32 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.59 2010/02/12 22:23:40 skrll Exp $"); #include "locators.h" #include "power.h" @@ -1101,6 +1101,7 @@ int ops) { int i; + /* * Mixing of PRE and POST operations is not allowed. */ @@ -1112,7 +1113,7 @@ if (offset >= map->dm_mapsize) panic("mbus_dmamap_sync: bad offset %lu (map size is %lu)", offset, map->dm_mapsize); - if (len == 0 || (offset + len) > map->dm_mapsize) + if ((offset + len) > map->dm_mapsize) panic("mbus_dmamap_sync: bad length"); #endif @@ -1133,7 +1134,7 @@ */ ops &= (BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); - if (ops == 0) + if (len == 0 || ops == 0) return; for (i = 0; len != 0 && i < map->dm_nsegs; i++) {