diff options
| author | martin <martin@NetBSD.org> | 2009-05-02 22:09:39 +0000 |
|---|---|---|
| committer | martin <martin@NetBSD.org> | 2009-05-02 22:09:39 +0000 |
| commit | 9b2932709e1c709c04fd70a83e159aecb4433673 (patch) | |
| tree | f46227086762922f6f79cc1825fdf62f003bcf7f /sys/dev | |
| parent | b1bd59c57778ab82e6becf253eae77b3a86a2eb3 (diff) | |
If we are unlucky, during detach of child devices, after a uhub has detached,
our uhci_poll_hub callout might strike. The detaching of the uhub has left
the device member in the pipe NULL, so make sure we do not dereference it.
We could halt the callout before detaching child devices, but it this
would likely interfere with proper servicing the child devices while
they are still around.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/usb/uhci.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c index 02204256690..dadb217cecd 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -1,4 +1,4 @@ -/* $NetBSD: uhci.c,v 1.226 2009/04/19 12:32:52 ad Exp $ */ +/* $NetBSD: uhci.c,v 1.227 2009/05/02 22:09:39 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.226 2009/04/19 12:32:52 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.227 2009/05/02 22:09:39 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1034,12 +1034,14 @@ uhci_poll_hub(void *addr) { usbd_xfer_handle xfer = addr; usbd_pipe_handle pipe = xfer->pipe; - uhci_softc_t *sc = pipe->device->bus->hci_private; + uhci_softc_t *sc; int s; u_char *p; DPRINTFN(20, ("uhci_poll_hub\n")); + if (pipe->device == NULL) return; /* device has detached */ + sc = pipe->device->bus->hci_private; usb_callout(sc->sc_poll_handle, sc->sc_ival, uhci_poll_hub, xfer); p = KERNADDR(&xfer->dmabuf, 0); |
