summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/ohci.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1998-12-11 06:02:06 +0000
committerjulian <julian@FreeBSD.org>1998-12-11 06:02:06 +0000
commit1f33b54c67654a34d137c2ecba58ac83385845a9 (patch)
tree60e1d84156a1f5df0b8b57e7472bf1f531d4b336 /sys/dev/usb/ohci.c
parente8b75f9d73d1484c6406a0269b77f65e04899333 (diff)
downloadFreeBSD-src-1f33b54c67654a34d137c2ecba58ac83385845a9.zip
FreeBSD-src-1f33b54c67654a34d137c2ecba58ac83385845a9.tar.gz
If we failed to probe/attach somehow, we never have a sc->sc_hcca
but the present PCI probe code still thinks we are there as the pci attach can't return an error code. This means we are in the shared interrupt list, but have not been set up. If we are sharing ints with another device, ohci_intr will be called and will coredump on a NULL reference. So just return if it is called when not set up. This fixes the symptom and not the cause. The right answer is to let the PCI system know that the attach failed, or to fail earlier (in the PCI probe). The attach() is a void fn() so it can't return failure..
Diffstat (limited to 'sys/dev/usb/ohci.c')
-rw-r--r--sys/dev/usb/ohci.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index 2232fad..86bc3ac 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -542,6 +542,9 @@ ohci_intr(p)
u_int32_t intrs, eintrs;
ohci_physaddr_t done;
+ if ((sc == NULL) || (sc->sc_hcca == NULL))
+ return (0);
+
done = sc->sc_hcca->hcca_done_head;
if (done != 0) {
intrs = OHCI_WDH;
OpenPOWER on IntegriCloud