From 955c72c194bf7e82b4fff0dc198003d84bdd86b0 Mon Sep 17 00:00:00 2001 From: Jacob Meuser Date: Wed, 27 Oct 2010 17:51:12 +0000 Subject: don't free network related resources if they were not allocated --- sys/dev/usb/if_ral.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/dev/usb/if_ral.c') 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)) -- cgit v1.2.3