diff --git a/module/zfs/dmu_objset.c b/module/zfs/dmu_objset.c index 7e3a5fb20..acfc7f048 100644 --- a/module/zfs/dmu_objset.c +++ b/module/zfs/dmu_objset.c @@ -1785,6 +1785,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); } @@ -1796,6 +1797,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;