Skip to content

Commit 48482bb

Browse files
amotintonyhutter
authored andcommitted
Properly release key in spa_keystore_dsl_key_hold_dd()
Since dsl_crypto_key_open() references the key, 0d23f5e should have called dsl_crypto_key_rele() to drop it first instead of calling dsl_crypto_key_free() directly. The final result should actually be the same, but without triggering dck_holds assertion. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Closes openzfs#16567
1 parent 21c40e6 commit 48482bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

module/zfs/dsl_crypt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ spa_keystore_dsl_key_hold_dd(spa_t *spa, dsl_dir_t *dd, const void *tag,
717717
avl_insert(&spa->spa_keystore.sk_dsl_keys, dck_io, where);
718718
*dck_out = dck_io;
719719
} else {
720-
dsl_crypto_key_free(dck_io);
720+
dsl_crypto_key_rele(dck_io, tag);
721721
*dck_out = dck_ks;
722722
}
723723

0 commit comments

Comments
 (0)