From e56766360bd392bf9b8e5b9c2285ed35e1a066ea Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 26 Jan 2016 17:54:45 -0800 Subject: [PATCH] Illumos 6495 - Fix mutex leak in dmu_objset_find_dp 6495 Fix mutex leak in dmu_objset_find_dp Reviewed by: George Wilson Reviewed by: Matthew Ahrens Approved by: Albert Lee References: https://www.illumos.org/issues/6495 https://github.com/illumos/illumos-gate/commit/2bad225 Ported-by: Signed-off-by: Brian Behlendorf Signed-off-by: Chunwei Chen --- module/zfs/dmu_objset.c | 3 +++ 1 file changed, 3 insertions(+) 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;