Module Name:    src
Committed By:   martin
Date:           Sat May  2 22:28:41 UTC 2009

Modified Files:
        src/sys/dev/usb: uhci.c

Log Message:
Correct previous: detaching uhubN makes the bus pointer NULL


To generate a diff of this commit:
cvs rdiff -u -r1.227 -r1.228 src/sys/dev/usb/uhci.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/usb/uhci.c
diff -u src/sys/dev/usb/uhci.c:1.227 src/sys/dev/usb/uhci.c:1.228
--- src/sys/dev/usb/uhci.c:1.227	Sat May  2 22:09:39 2009
+++ src/sys/dev/usb/uhci.c	Sat May  2 22:28:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhci.c,v 1.227 2009/05/02 22:09:39 martin Exp $	*/
+/*	$NetBSD: uhci.c,v 1.228 2009/05/02 22:28:41 martin Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $	*/
 
 /*
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.227 2009/05/02 22:09:39 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.228 2009/05/02 22:28:41 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1040,7 +1040,8 @@
 
 	DPRINTFN(20, ("uhci_poll_hub\n"));
 
-	if (pipe->device == NULL) return;	/* device has detached */
+	if (__predict_false(pipe->device == NULL || pipe->device->bus == NULL))
+		return;	/* device has detached */
 	sc = pipe->device->bus->hci_private;
 	usb_callout(sc->sc_poll_handle, sc->sc_ival, uhci_poll_hub, xfer);
 

Reply via email to