From 5aaf8793f4103b4069f9de6f81cf686c78d4f1b1 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Mon, 22 May 2006 15:26:08 +0000 Subject: Don't call shutdownhook_disestablish() unless there is a shutdownhook established. Should fix PR #5128. ok dlg@ --- sys/dev/usb/ohci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c index 9a98850b372..cabae65da4d 100644 --- a/sys/dev/usb/ohci.c +++ b/sys/dev/usb/ohci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ohci.c,v 1.66 2006/05/04 14:21:30 jolan Exp $ */ +/* $OpenBSD: ohci.c,v 1.67 2006/05/22 15:26:07 krw Exp $ */ /* $NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $ */ /* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */ @@ -373,7 +373,8 @@ ohci_detach(struct ohci_softc *sc, int flags) usb_uncallout(sc->sc_tmo_rhsc, ohci_rhsc_enable, sc); #if defined(__NetBSD__) || defined(__OpenBSD__) - shutdownhook_disestablish(sc->sc_shutdownhook); + if (sc->sc_shutdownhook != NULL) + shutdownhook_disestablish(sc->sc_shutdownhook); #endif usb_delay_ms(&sc->sc_bus, 300); /* XXX let stray task complete */ -- cgit v1.2.3