aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/dsl_dir.c
diff options
context:
space:
mode:
authorDon Brady <[email protected]>2018-08-03 15:50:51 -0600
committerBrian Behlendorf <[email protected]>2018-08-03 14:50:51 -0700
commitfc1ecd16d735eb35939a5cae9488b00b1539e383 (patch)
treecf75f806ad932af3b6c0e7453b6943eabe1486c0 /module/zfs/dsl_dir.c
parent6da0998f592a322ca045dec1c9db61333c9936dc (diff)
zfs_ioc_unload_key can drop extra spa ref
Reviewed by: Thomas Caputi <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Don Brady <[email protected]> Closes #7759
Diffstat (limited to 'module/zfs/dsl_dir.c')
-rw-r--r--module/zfs/dsl_dir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/zfs/dsl_dir.c b/module/zfs/dsl_dir.c
index 9a43691e5..5b6ce0420 100644
--- a/module/zfs/dsl_dir.c
+++ b/module/zfs/dsl_dir.c
@@ -501,7 +501,8 @@ dsl_dir_hold(dsl_pool_t *dp, const char *name, void *tag,
}
if (tailp != NULL)
*tailp = next;
- *ddp = dd;
+ if (err == 0)
+ *ddp = dd;
error:
kmem_free(buf, ZFS_MAX_DATASET_NAME_LEN);
return (err);