summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2013-04-04 09:15:19 +0000
committermav <mav@FreeBSD.org>2013-04-04 09:15:19 +0000
commit26b501bbebbd4f6ac0c67678530b28fda02b7556 (patch)
tree857248108ed3ca48d9c526b7626c82bc6c19d2e6
parent83b6fc7d70a6576a4179a478584d698567df2fd2 (diff)
downloadFreeBSD-src-26b501bbebbd4f6ac0c67678530b28fda02b7556.zip
FreeBSD-src-26b501bbebbd4f6ac0c67678530b28fda02b7556.tar.gz
Check status of ahci_em_reset() on attach and abort if reset failed.
For now it is just a hypothetical case. Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
-rw-r--r--sys/dev/ahci/ahciem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/ahci/ahciem.c b/sys/dev/ahci/ahciem.c
index 389da3f..d96f044 100644
--- a/sys/dev/ahci/ahciem.c
+++ b/sys/dev/ahci/ahciem.c
@@ -104,7 +104,10 @@ ahci_em_attach(device_t dev)
} else
enc->r_memr = NULL;
mtx_lock(&enc->mtx);
- ahci_em_reset(dev);
+ if (ahci_em_reset(dev) != 0) {
+ error = ENXIO;
+ goto err1;
+ }
rid = ATA_IRQ_RID;
/* Create the device queue for our SIM. */
devq = cam_simq_alloc(1);
OpenPOWER on IntegriCloud