From 8c918526a55466bbce7babb76e0ee3f8c8ec7318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Schmidt?= Date: Fri, 24 Mar 2000 07:44:20 +0000 Subject: [PATCH] Fix the panic occuring on non-changer devices. --- sys/dev/ata/atapi-cd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index b34a89915d44..4735d1ad1e0b 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -494,7 +494,7 @@ acdopen(dev_t dev, int32_t flags, int32_t fmt, struct proc *p) return EBUSY; } if (count_dev(dev) == 1) { - if (cdp->slot != cdp->changer_info->current_slot) { + if (cdp->changer_info && cdp->slot != cdp->changer_info->current_slot) { acd_select_slot(cdp); tsleep(&cdp->changer_info, PRIBIO, "acdopn", 0); } @@ -515,7 +515,7 @@ acdclose(dev_t dev, int32_t flags, int32_t fmt, struct proc *p) struct acd_softc *cdp = dev->si_drv1; if (count_dev(dev) == 1) { - if (cdp->slot != cdp->changer_info->current_slot) { + if (cdp->changer_info && cdp->slot != cdp->changer_info->current_slot) { acd_select_slot(cdp); tsleep(&cdp->changer_info, PRIBIO, "acdclo", 0); } @@ -531,7 +531,7 @@ acdioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flags, struct proc *p) struct acd_softc *cdp = dev->si_drv1; int32_t error = 0; - if (cdp->slot != cdp->changer_info->current_slot) { + if (cdp->changer_info && cdp->slot != cdp->changer_info->current_slot) { acd_select_slot(cdp); tsleep(&cdp->changer_info, PRIBIO, "acdctl", 0); }