MFC r287100: spa_import_rootpool: prevent lock and resource leak

PR:		198563
This commit is contained in:
avg 2015-09-11 13:32:19 +00:00
parent c83542f5e0
commit 5be2a0f48e

View File

@ -4129,6 +4129,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);