diff options
author | avg <avg@FreeBSD.org> | 2015-08-24 08:44:44 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2015-08-24 08:44:44 +0000 |
commit | 69063f1a99f157936ea689dadf2e9a4fbebc8fa3 (patch) | |
tree | a0768100bb47d11be6cf3088f0a5c98e743001c2 /sys/cddl | |
parent | 98538c87be86d8ebdb1ccf4cd2db806cc095b497 (diff) | |
download | FreeBSD-src-69063f1a99f157936ea689dadf2e9a4fbebc8fa3.zip FreeBSD-src-69063f1a99f157936ea689dadf2e9a4fbebc8fa3.tar.gz |
spa_import_rootpool: prevent lock and resource leak
The lock leak could lead to a deadlock later.
PR: 198563
Submitted by: Fabian Keil <fk@fabiankeil.de>
MFC after: 1 week
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c index a5389c3..d2085bb 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c @@ -4146,6 +4146,8 @@ spa_import_rootpool(const char *name) &spa->spa_ubsync.ub_version) != 0) spa->spa_ubsync.ub_version = SPA_VERSION_INITIAL; } else if ((spa = spa_lookup(name)) == NULL) { + mutex_exit(&spa_namespace_lock); + nvlist_free(config); cmn_err(CE_NOTE, "Cannot find the pool label for '%s'", name); return (EIO); |