From 5b972eaa75bb5b34836068e7f6d55dccc2b1cd23 Mon Sep 17 00:00:00 2001 From: imp Date: Thu, 15 Feb 2007 07:22:27 +0000 Subject: 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. --- sys/dev/exca/exca.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/dev/exca/exca.c') 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); } -- cgit v1.1