svn commit: r259222 - head/sys/dev/ahci
Alexander Motin
mav at FreeBSD.org
Wed Dec 11 17:40:36 UTC 2013
Author: mav
Date: Wed Dec 11 17:40:35 2013
New Revision: 259222
URL: http://svnweb.freebsd.org/changeset/base/259222
Log:
Destroy mtx lock when failed to allocate memory during attach.
Submitted by: Dmitry Luhtionov <dmitryluhtionov at gmail.com>
MFC after: 2 weeks
Modified:
head/sys/dev/ahci/ahciem.c
Modified: head/sys/dev/ahci/ahciem.c
==============================================================================
--- head/sys/dev/ahci/ahciem.c Wed Dec 11 17:18:10 2013 (r259221)
+++ head/sys/dev/ahci/ahciem.c Wed Dec 11 17:40:35 2013 (r259222)
@@ -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,
More information about the svn-src-head
mailing list