summaryrefslogtreecommitdiffstats
path: root/sys/dev/exca
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2007-02-15 07:22:27 +0000
committerimp <imp@FreeBSD.org>2007-02-15 07:22:27 +0000
commit5b972eaa75bb5b34836068e7f6d55dccc2b1cd23 (patch)
tree16d4f30a1c07375a16af4c4f9008aacd4db6e70b /sys/dev/exca
parentb0a1de450233d09e5dd7d67549686aff67b8ddc1 (diff)
downloadFreeBSD-src-5b972eaa75bb5b34836068e7f6d55dccc2b1cd23.zip
FreeBSD-src-5b972eaa75bb5b34836068e7f6d55dccc2b1cd23.tar.gz
It turns out that it is easier to not NULL out pccard and cardbus
device pointers. They don't change as the children device drivers come and go. Rather, check to see if the device is attached where we would have checked ! NULL. This solves many asymmetries in the code that likely could lead to crashes when loading/unloading cbb without one or more of the expected children's driver not present.
Diffstat (limited to 'sys/dev/exca')
-rw-r--r--sys/dev/exca/exca.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/exca/exca.c b/sys/dev/exca/exca.c
index 8845e65..a46ba47 100644
--- a/sys/dev/exca/exca.c
+++ b/sys/dev/exca/exca.c
@@ -780,7 +780,7 @@ exca_insert(struct exca_softc *exca)
void
exca_removal(struct exca_softc *exca)
{
- if (exca->pccarddev != NULL)
+ if (device_is_attached(exca->pccarddev))
CARD_DETACH_CARD(exca->pccarddev);
}
OpenPOWER on IntegriCloud