diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index e96105a8555c..c919b67346c4 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -992,10 +992,13 @@ cbb_insert(struct cbb_softc *sc) static void cbb_removal(struct cbb_softc *sc) { - if (sc->flags & CBB_16BIT_CARD && sc->pccarddev != NULL) - CARD_DETACH_CARD(sc->pccarddev); - else if ((!(sc->flags & CBB_16BIT_CARD)) && sc->cbdev != NULL) - CARD_DETACH_CARD(sc->cbdev); + if (sc->flags & CBB_16BIT_CARD) { + if (sc->pccarddev != NULL) + CARD_DETACH_CARD(sc->pccarddev); + } else { + if (sc->cbdev != NULL) + CARD_DETACH_CARD(sc->cbdev); + } cbb_destroy_res(sc); }