diff --git a/uts/common/fs/zfs/dmu_objset.c b/uts/common/fs/zfs/dmu_objset.c index 79de1d127d42..85465ec94334 100644 --- a/uts/common/fs/zfs/dmu_objset.c +++ b/uts/common/fs/zfs/dmu_objset.c @@ -1789,6 +1789,7 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint64_t ddobj, * thread suffices. For now, stay single threaded. */ dmu_objset_find_dp_impl(dcp); + mutex_destroy(&err_lock); return (error); } @@ -1800,6 +1801,8 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint64_t ddobj, INT_MAX, 0); if (tq == NULL) { kmem_free(dcp, sizeof (*dcp)); + mutex_destroy(&err_lock); + return (SET_ERROR(ENOMEM)); } dcp->dc_tq = tq;