From 32dbed04886c711e6a535c63f305620505516267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Schmidt?= Date: Fri, 5 Apr 2002 18:37:04 +0000 Subject: [PATCH] Unlock the channel again if an ata_reinit() fails. --- sys/dev/ata/ata-all.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index 5caa2f033160..3e437a9a99c0 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -303,7 +303,8 @@ ataioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td) if (!device || !(ch = device_get_softc(device))) return ENXIO; ATA_SLEEPLOCK_CH(ch, ATA_ACTIVE); - error = ata_reinit(ch); + if ((error = ata_reinit(ch))) + ATA_UNLOCK_CH(ch); return error; case ATAGMODE: @@ -838,6 +839,7 @@ ata_reinit(struct ata_channel *ch) if (!ch->r_io || !ch->r_altio || !ch->r_irq) return ENXIO; + ATA_FORCELOCK_CH(ch, ATA_CONTROL); ch->running = NULL; devices = ch->devices;