Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/nick-nhusb]: src/sys/dev/usb Sanity checks in ohci_dump_tds



details:   https://anonhg.NetBSD.org/src/rev/3ca8bf9236c1
branches:  nick-nhusb
changeset: 334327:3ca8bf9236c1
user:      skrll <skrll%NetBSD.org@localhost>
date:      Wed Dec 02 20:36:50 2015 +0000

description:
Sanity checks in ohci_dump_tds

diffstat:

 sys/dev/usb/ohci.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r b327c1a2095b -r 3ca8bf9236c1 sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c        Wed Dec 02 20:07:08 2015 +0000
+++ b/sys/dev/usb/ohci.c        Wed Dec 02 20:36:50 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci.c,v 1.254.2.33 2015/12/02 07:40:29 skrll Exp $    */
+/*     $NetBSD: ohci.c,v 1.254.2.34 2015/12/02 20:36:50 skrll Exp $    */
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.254.2.33 2015/12/02 07:40:29 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.254.2.34 2015/12/02 20:36:50 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -1856,8 +1856,11 @@
 void
 ohci_dump_tds(ohci_softc_t *sc, ohci_soft_td_t *std)
 {
-       for (; std; std = std->nexttd)
+       for (; std; std = std->nexttd) {
                ohci_dump_td(sc, std);
+               KASSERTMSG(std->nexttd == NULL || std != std->nexttd,
+                   "std %p next %p", std, std->nexttd);
+       }
 }
 
 void



Home | Main Index | Thread Index | Old Index