summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2003-09-05 03:08:08 +0000
committerimp <imp@FreeBSD.org>2003-09-05 03:08:08 +0000
commite4939ef70d19ccdf0ded64f018e067ceb3c9e6bf (patch)
tree315a646e92d8b420a60a23a420c899a0bd20a959
parent7bc9af7ebb66a587ff51554c03e76739020f82ac (diff)
downloadFreeBSD-src-e4939ef70d19ccdf0ded64f018e067ceb3c9e6bf.zip
FreeBSD-src-e4939ef70d19ccdf0ded64f018e067ceb3c9e6bf.tar.gz
Whacked out CIS configurations can cause us to not have any child. When
such a card is ejected, we'd panic. Instead, just ignore it. I should also add a sanity check in the FUNCID code as well, but this isn't wrong since the check is cheap and happens infrequently.
-rw-r--r--sys/dev/pccard/pccard.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c
index 055cdfd..368560f 100644
--- a/sys/dev/pccard/pccard.c
+++ b/sys/dev/pccard/pccard.c
@@ -284,14 +284,16 @@ pccard_detach_card(device_t dev)
struct pccard_softc *sc = PCCARD_SOFTC(dev);
struct pccard_function *pf;
struct pccard_config_entry *cfe;
+ int state;
/*
* We are running on either the PCCARD socket's event thread
* or in user context detaching a device by user request.
*/
STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) {
- int state = device_get_state(pf->dev);
-
+ if (pf->dev == NULL)
+ continue;
+ state = device_get_state(pf->dev);
if (state == DS_ATTACHED || state == DS_BUSY)
device_detach(pf->dev);
if (pf->cfe != NULL)
OpenPOWER on IntegriCloud