mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
Properly release key in spa_keystore_dsl_key_hold_dd()
Since dsl_crypto_key_open() references the key, 0d23f5e2e4 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 #16567
This commit is contained in:
1 parent
832f66b218
commit
48d1be254f
1 file changed
+1
-1
@@ -717,7 +717,7 @@ spa_keystore_dsl_key_hold_dd(spa_t *spa, dsl_dir_t *dd, const void *tag,
|
||||
avl_insert(&spa->spa_keystore.sk_dsl_keys, dck_io, where);
|
||||
*dck_out = dck_io;
|
||||
} else {
|
||||
dsl_crypto_key_free(dck_io);
|
||||
dsl_crypto_key_rele(dck_io, tag);
|
||||
*dck_out = dck_ks;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user