aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ahci
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2013-12-11 17:40:35 +0000
committerAlexander Motin <mav@FreeBSD.org>2013-12-11 17:40:35 +0000
commit8adff99c8df21e13298d835d206d612aea299387 (patch)
treedeec6c94468b62b3d608b28ffd1c63fa5928a987 /sys/dev/ahci
parent8528c7c86e6ba0447f65ad3f3006d5bcdea97691 (diff)
Notes
Diffstat (limited to 'sys/dev/ahci')
-rw-r--r--sys/dev/ahci/ahciem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/ahci/ahciem.c b/sys/dev/ahci/ahciem.c
index d96f044d7dcd..8785a7800e40 100644
--- a/sys/dev/ahci/ahciem.c
+++ b/sys/dev/ahci/ahciem.c
@@ -85,8 +85,10 @@ ahci_em_attach(device_t dev)
mtx_init(&enc->mtx, "AHCI enclosure lock", NULL, MTX_DEF);
rid = 0;
if (!(enc->r_memc = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
- &rid, RF_ACTIVE)))
+ &rid, RF_ACTIVE))) {
+ mtx_destroy(&enc->mtx);
return (ENXIO);
+ }
enc->capsem = ATA_INL(enc->r_memc, 0);
rid = 1;
if (!(enc->r_memt = bus_alloc_resource_any(dev, SYS_RES_MEMORY,