summaryrefslogtreecommitdiff
path: root/sys/dev/usb/if_ral.c
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2010-10-27 17:51:12 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2010-10-27 17:51:12 +0000
commit955c72c194bf7e82b4fff0dc198003d84bdd86b0 (patch)
treed36225e6b24e519f918b1ecaf995552ebf79287a /sys/dev/usb/if_ral.c
parent72c98d7491a3ceaf8fc8d6b18b3fa7c9664c0312 (diff)
don't free network related resources if they were not allocated
Diffstat (limited to 'sys/dev/usb/if_ral.c')
-rw-r--r--sys/dev/usb/if_ral.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c
index 4e7677f4ee9..c5dca41c525 100644
--- a/sys/dev/usb/if_ral.c
+++ b/sys/dev/usb/if_ral.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ral.c,v 1.115 2010/10/23 16:14:07 jakemsr Exp $ */
+/* $OpenBSD: if_ral.c,v 1.116 2010/10/27 17:51:11 jakemsr Exp $ */
/*-
* Copyright (c) 2005, 2006
@@ -363,8 +363,10 @@ ural_detach(struct device *self, int flags)
s = splusb();
- ieee80211_ifdetach(ifp); /* free all nodes */
- if_detach(ifp);
+ if (ifp->if_softc != NULL) {
+ ieee80211_ifdetach(ifp); /* free all nodes */
+ if_detach(ifp);
+ }
usb_rem_task(sc->sc_udev, &sc->sc_task);
if (timeout_initialized(&sc->scan_to))