diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-06-21 06:50:38 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-06-21 06:50:38 +0000 |
commit | 2fe7c08a41ea6efabe382802c415f978ddf27ad2 (patch) | |
tree | 01df0c0fbd706eb719fc2b9be6146ca679ae60ee /sys | |
parent | 2aa043eadcf9ddd0f06b6d5d5943e6b5a54e6c94 (diff) |
Don't set WI_FLAGS_ATTACHED in sc->wi_flags until after mi attach
routines have been called. Avoids a panic when you insert & eject
a card very quickly on a slow machine.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/if_wi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c index 77841bd8480..d77fc7de6ef 100644 --- a/sys/dev/ic/if_wi.c +++ b/sys/dev/ic/if_wi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi.c,v 1.68 2002/06/21 06:46:26 fgsch Exp $ */ +/* $OpenBSD: if_wi.c,v 1.69 2002/06/21 06:50:37 millert Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -124,7 +124,7 @@ u_int32_t widebug = WIDEBUG; #if !defined(lint) && !defined(__OpenBSD__) static const char rcsid[] = - "$OpenBSD: if_wi.c,v 1.68 2002/06/21 06:46:26 fgsch Exp $"; + "$OpenBSD: if_wi.c,v 1.69 2002/06/21 06:50:37 millert Exp $"; #endif /* lint */ #ifdef foo @@ -187,7 +187,7 @@ wi_attach(sc) struct ifnet *ifp; int error; - sc->wi_flags = WI_FLAGS_ATTACHED; + sc->wi_flags = 0; wi_cor_reset(sc); wi_reset(sc); @@ -383,6 +383,8 @@ wi_attach(sc) ether_ifattach(ifp); printf("\n"); + sc->wi_flags |= WI_FLAGS_ATTACHED; + #if NBPFILTER > 0 BPFATTACH(&sc->sc_arpcom.ac_if.if_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header)); |