diff options
author | sos <sos@FreeBSD.org> | 2006-03-09 10:25:35 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2006-03-09 10:25:35 +0000 |
commit | 05ddef311283ee55e106f28ab7ee3c6af6668a8a (patch) | |
tree | 0e991630dc723b2a95866b6295a7685c3180b1be /sys/dev | |
parent | e55404d344729ae35423e66d057c096543beaad9 (diff) | |
download | FreeBSD-src-05ddef311283ee55e106f28ab7ee3c6af6668a8a.zip FreeBSD-src-05ddef311283ee55e106f28ab7ee3c6af6668a8a.tar.gz |
Only use the channel in the request given to ata_completed if its
still present.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ata/ata-queue.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/ata/ata-queue.c b/sys/dev/ata/ata-queue.c index 3ff257b..a3b142e 100644 --- a/sys/dev/ata/ata-queue.c +++ b/sys/dev/ata/ata-queue.c @@ -270,10 +270,12 @@ ata_completed(void *context, int dummy) /* if we had a timeout, reinit channel and deal with the falldown */ if (request->flags & ATA_R_TIMEOUT) { /* - * if reinit succeeds and the device doesn't get detached and + * if the channel is still present and + * reinit succeeds and + * the device doesn't get detached and * there are retries left we reinject this request */ - if (!ata_reinit(ch->dev) && !request->result && + if (ch && !ata_reinit(ch->dev) && !request->result && (request->retries-- > 0)) { if (!(request->flags & ATA_R_QUIET)) { device_printf(request->dev, @@ -473,7 +475,9 @@ ata_completed(void *context, int dummy) else sema_post(&request->done); - ata_start(ch->dev); + /* only call ata_start if channel is present */ + if (ch) + ata_start(ch->dev); } void |