diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index b4490eb57e4..5caa2f03316 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -215,7 +215,8 @@ ata_detach(device_t dev) struct ata_channel *ch; int s; - if (!dev || !(ch = device_get_softc(dev))) + if (!dev || !(ch = device_get_softc(dev)) || + !ch->r_io || !ch->r_altio || !ch->r_irq) return ENXIO; /* make sure channel is not busy */