summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/zfs/abd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/module/zfs/abd.c b/module/zfs/abd.c
index 7d3a2f6d6..1e6645c90 100644
--- a/module/zfs/abd.c
+++ b/module/zfs/abd.c
@@ -555,8 +555,12 @@ abd_get_offset_impl(abd_t *abd, abd_t *sabd, size_t off, size_t size)
abd_t *
abd_get_offset_struct(abd_t *abd, abd_t *sabd, size_t off, size_t size)
{
+ abd_t *result;
abd_init_struct(abd);
- return (abd_get_offset_impl(abd, sabd, off, size));
+ result = abd_get_offset_impl(abd, sabd, off, size);
+ if (result != abd)
+ abd_fini_struct(abd);
+ return (result);
}
abd_t *