Module Name:    src
Committed By:   jdc
Date:           Sat Dec  5 16:48:26 UTC 2009

Modified Files:
        src/sys/arch/sparc64/dev: iommu.c

Log Message:
Avoid a panic if we are asked to sync a zero-length map, by returning
immediately.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/sparc64/dev/iommu.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/sparc64/dev/iommu.c
diff -u src/sys/arch/sparc64/dev/iommu.c:1.88 src/sys/arch/sparc64/dev/iommu.c:1.89
--- src/sys/arch/sparc64/dev/iommu.c:1.88	Sat Nov  7 07:27:46 2009
+++ src/sys/arch/sparc64/dev/iommu.c	Sat Dec  5 16:48:26 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: iommu.c,v 1.88 2009/11/07 07:27:46 cegger Exp $	*/
+/*	$NetBSD: iommu.c,v 1.89 2009/12/05 16:48:26 jdc Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.88 2009/11/07 07:27:46 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.89 2009/12/05 16:48:26 jdc Exp $");
 
 #include "opt_ddb.h"
 
@@ -1000,6 +1000,10 @@
 	bus_size_t len, int ops)
 {
 
+	/* If len is 0, then there is nothing to do */
+	if (len == 0)
+		return;
+
 	if (ops & (BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE)) {
 		/* Flush the CPU then the IOMMU */
 		bus_dmamap_sync(t->_parent, map, offset, len, ops);

Reply via email to