summaryrefslogtreecommitdiff
path: root/sys/dev/usb/if_zyd.c
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2010-10-23 16:14:08 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2010-10-23 16:14:08 +0000
commitdb9058be5229697001a5d46f83b0dd4ab66a8695 (patch)
tree9eea560f87590a129aa562cec2d2b6040ae93079 /sys/dev/usb/if_zyd.c
parentbdc249af6535dd1a757df6cdbe97fbd299400ed4 (diff)
check that a timeout(9) has been initialized before deleting it
ok phessler
Diffstat (limited to 'sys/dev/usb/if_zyd.c')
-rw-r--r--sys/dev/usb/if_zyd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/usb/if_zyd.c b/sys/dev/usb/if_zyd.c
index ca1cdc28939..c1066de374b 100644
--- a/sys/dev/usb/if_zyd.c
+++ b/sys/dev/usb/if_zyd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_zyd.c,v 1.83 2010/10/23 15:42:09 jakemsr Exp $ */
+/* $OpenBSD: if_zyd.c,v 1.84 2010/10/23 16:14:07 jakemsr Exp $ */
/*-
* Copyright (c) 2006 by Damien Bergamini <damien.bergamini@free.fr>
@@ -443,8 +443,10 @@ zyd_detach(struct device *self, int flags)
s = splusb();
usb_rem_task(sc->sc_udev, &sc->sc_task);
- timeout_del(&sc->scan_to);
- timeout_del(&sc->amrr_to);
+ if (timeout_initialized(&sc->scan_to))
+ timeout_del(&sc->scan_to);
+ if (timeout_initialized(&sc->amrr_to))
+ timeout_del(&sc->amrr_to);
zyd_close_pipes(sc);