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 PR kern/48243 (inconsistant usage of 'up->p...



details:   https://anonhg.NetBSD.org/src/rev/5ecbdc3ff58c
branches:  nick-nhusb
changeset: 334547:5ecbdc3ff58c
user:      skrll <skrll%NetBSD.org@localhost>
date:      Wed Oct 26 07:31:24 2016 +0000

description:
PR kern/48243 (inconsistant usage of 'up->parent' in usb_subr.c)

Add a KASSERT and comment to explain what's going on.

diffstat:

 sys/dev/usb/usb_subr.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r a3b4301d3736 -r 5ecbdc3ff58c sys/dev/usb/usb_subr.c
--- a/sys/dev/usb/usb_subr.c    Tue Oct 25 07:32:25 2016 +0000
+++ b/sys/dev/usb/usb_subr.c    Wed Oct 26 07:31:24 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_subr.c,v 1.198.2.34 2016/10/07 10:37:42 skrll Exp $        */
+/*     $NetBSD: usb_subr.c,v 1.198.2.35 2016/10/26 07:31:24 skrll Exp $        */
 /*     $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $   */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.198.2.34 2016/10/07 10:37:42 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.198.2.35 2016/10/26 07:31:24 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1261,6 +1261,11 @@
                err = usbd_get_initial_ddesc(dev, dd);
                if (!err)
                        break;
+               /*
+                * The root hub can never fail to give the initial descriptor,
+                * but assert it just in case.
+                */
+               KASSERT(up->up_parent);
                usbd_delay_ms(dev, 200);
                if ((i & 3) == 3)
                        usbd_reset_port(up->up_parent, port, &ps);



Home | Main Index | Thread Index | Old Index