summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ata/ata-queue.c10
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
OpenPOWER on IntegriCloud