diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2010-10-23 16:14:08 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2010-10-23 16:14:08 +0000 |
commit | db9058be5229697001a5d46f83b0dd4ab66a8695 (patch) | |
tree | 9eea560f87590a129aa562cec2d2b6040ae93079 /sys/dev/usb/if_run.c | |
parent | bdc249af6535dd1a757df6cdbe97fbd299400ed4 (diff) |
check that a timeout(9) has been initialized before deleting it
ok phessler
Diffstat (limited to 'sys/dev/usb/if_run.c')
-rw-r--r-- | sys/dev/usb/if_run.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/usb/if_run.c b/sys/dev/usb/if_run.c index 091f89bacb6..f7aa8c9aae4 100644 --- a/sys/dev/usb/if_run.c +++ b/sys/dev/usb/if_run.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_run.c,v 1.73 2010/10/23 15:42:09 jakemsr Exp $ */ +/* $OpenBSD: if_run.c,v 1.74 2010/10/23 16:14:07 jakemsr Exp $ */ /*- * Copyright (c) 2008-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -595,8 +595,10 @@ run_detach(struct device *self, int flags) while (sc->cmdq.queued > 0) tsleep(&sc->cmdq, 0, "cmdq", 0); - timeout_del(&sc->scan_to); - timeout_del(&sc->calib_to); + if (timeout_initialized(&sc->scan_to)) + timeout_del(&sc->scan_to); + if (timeout_initialized(&sc->calib_to)) + timeout_del(&sc->calib_to); if (ifp->if_flags != 0) { /* if_attach() has been called */ ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); |