summaryrefslogtreecommitdiff
path: root/sys/dev/pcmcia/if_wi_pcmcia.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2005-01-21 03:32:22 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2005-01-21 03:32:22 +0000
commit9fdf897dbb9222ff8b33e9cb77503f93bf4df82e (patch)
tree47ab44bc7ae30c0f61ee4b6086941101277ded66 /sys/dev/pcmcia/if_wi_pcmcia.c
parent544ed48cab2c3caf2355a98e0d8293ac10771380 (diff)
Undo last change; if wi_pcmcia_attach failed we already freed up the
pcmcia resources and trying to do it again will cause problems. Just return silently if WI_FLAGS_ATTACHED is not set in wi_flags.
Diffstat (limited to 'sys/dev/pcmcia/if_wi_pcmcia.c')
-rw-r--r--sys/dev/pcmcia/if_wi_pcmcia.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pcmcia/if_wi_pcmcia.c b/sys/dev/pcmcia/if_wi_pcmcia.c
index 6bb64a520c5..d2bfaee5bf6 100644
--- a/sys/dev/pcmcia/if_wi_pcmcia.c
+++ b/sys/dev/pcmcia/if_wi_pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_pcmcia.c,v 1.58 2005/01/20 00:44:28 millert Exp $ */
+/* $OpenBSD: if_wi_pcmcia.c,v 1.59 2005/01/21 03:32:21 millert Exp $ */
/* $NetBSD: if_wi_pcmcia.c,v 1.14 2001/11/26 04:34:56 ichiro Exp $ */
/*
@@ -447,6 +447,9 @@ wi_pcmcia_detach(dev, flags)
struct wi_softc *sc = &psc->sc_wi;
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+ if (!(sc->wi_flags & WI_FLAGS_ATTACHED))
+ return (0);
+
wi_detach(sc);
sc->wi_flags = 0;