From: Will Andrews Date: Sun, 26 Apr 2015 22:30:46 +0000 (-0700) Subject: Illumos 5814 - bpobj_iterate_impl(): Close a refcount leak iterating on a sublist. X-Git-Tag: zfs-0.6.5~165 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=50f9ea01499be508918e33923e004bf5dcf390e3;p=zfs Illumos 5814 - bpobj_iterate_impl(): Close a refcount leak iterating on a sublist. 5814 bpobj_iterate_impl(): Close a refcount leak iterating on a sublist. Reviewed by: Prakash Surya Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Simon Klinkert Approved by: Gordon Ross References: https://www.illumos.org/issues/5814 https://github.com/illumos/illumos-gate/commit/b67dde11 Ported-by: DHE Signed-off-by: Brian Behlendorf Closes #3368 --- diff --git a/module/zfs/bpobj.c b/module/zfs/bpobj.c index 7c8f932f5..25767e83f 100644 --- a/module/zfs/bpobj.c +++ b/module/zfs/bpobj.c @@ -301,8 +301,10 @@ bpobj_iterate_impl(bpobj_t *bpo, bpobj_itor_t func, void *arg, dmu_tx_t *tx, if (free) { err = bpobj_space(&sublist, &used_before, &comp_before, &uncomp_before); - if (err) + if (err != 0) { + bpobj_close(&sublist); break; + } } err = bpobj_iterate_impl(&sublist, func, arg, tx, free); if (free) {