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_upgt.c | |
parent | bdc249af6535dd1a757df6cdbe97fbd299400ed4 (diff) |
check that a timeout(9) has been initialized before deleting it
ok phessler
Diffstat (limited to 'sys/dev/usb/if_upgt.c')
-rw-r--r-- | sys/dev/usb/if_upgt.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/usb/if_upgt.c b/sys/dev/usb/if_upgt.c index 9041549656e..88cee518788 100644 --- a/sys/dev/usb/if_upgt.c +++ b/sys/dev/usb/if_upgt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_upgt.c,v 1.51 2010/10/23 15:42:09 jakemsr Exp $ */ +/* $OpenBSD: if_upgt.c,v 1.52 2010/10/23 16:14:07 jakemsr Exp $ */ /* * Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org> @@ -486,8 +486,10 @@ upgt_detach(struct device *self, int flags) /* remove tasks and timeouts */ usb_rem_task(sc->sc_udev, &sc->sc_task_newstate); usb_rem_task(sc->sc_udev, &sc->sc_task_tx); - timeout_del(&sc->scan_to); - timeout_del(&sc->led_to); + if (timeout_initialized(&sc->scan_to)) + timeout_del(&sc->scan_to); + if (timeout_initialized(&sc->led_to)) + timeout_del(&sc->led_to); /* free xfers */ upgt_free_tx(sc); |