Module Name:    src
Committed By:   kiyohara
Date:           Mon Apr 19 07:00:58 UTC 2010

Modified Files:
        src/sys/dev/ieee1394: fwohci.c

Log Message:
Fix a bug.
  STAILQ is not NULL termination.


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/dev/ieee1394/fwohci.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/dev/ieee1394/fwohci.c
diff -u src/sys/dev/ieee1394/fwohci.c:1.123 src/sys/dev/ieee1394/fwohci.c:1.124
--- src/sys/dev/ieee1394/fwohci.c:1.123	Mon Mar 29 07:34:02 2010
+++ src/sys/dev/ieee1394/fwohci.c	Mon Apr 19 07:00:58 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwohci.c,v 1.123 2010/03/29 07:34:02 kiyohara Exp $	*/
+/*	$NetBSD: fwohci.c,v 1.124 2010/04/19 07:00:58 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  *
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fwohci.c,v 1.123 2010/03/29 07:34:02 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwohci.c,v 1.124 2010/04/19 07:00:58 kiyohara Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -1689,12 +1689,12 @@
 static void
 fwohci_db_free(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
 {
-	struct fwohcidb_tr *db_tr;
+	struct fwohcidb_tr *db_tr, *last;
 
 	if ((dbch->flags & FWOHCI_DBCH_INIT) == 0)
 		return;
 
-	for (db_tr = STAILQ_FIRST(&dbch->db_trq); db_tr != NULL;
+	for (last = db_tr = STAILQ_FIRST(&dbch->db_trq); db_tr != last;
 	    db_tr = STAILQ_NEXT(db_tr, link)) {
 		bus_dmamap_destroy(sc->fc.dmat, db_tr->dma_map);
 		if ((dbch->xferq.flag & FWXFERQ_EXTBUF) == 0 &&

Reply via email to