mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 02:49:32 +03:00
Fix ICP memleak introduced in #4760
The ICP requires destructors to for each crypto module that is added. These do not necessarily exist in Illumos because they assume that these modules can never be unloaded from the kernel. Some of this cleanup code was missed when #4760 was merged, resulting in leaks. This patch simply fixes that. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tom Caputi <tcaputi@datto.com> Issue #4760 Closes #5265
This commit is contained in:
parent
06cf4d9890
commit
ef78750d98
@ -231,6 +231,19 @@ skein_mod_init(void)
|
||||
|
||||
int
|
||||
skein_mod_fini(void) {
|
||||
int ret;
|
||||
|
||||
if (skein_prov_handle != 0) {
|
||||
if ((ret = crypto_unregister_provider(skein_prov_handle)) !=
|
||||
CRYPTO_SUCCESS) {
|
||||
cmn_err(CE_WARN,
|
||||
"skein _fini: crypto_unregister_provider() "
|
||||
"failed (0x%x)", ret);
|
||||
return (EBUSY);
|
||||
}
|
||||
skein_prov_handle = 0;
|
||||
}
|
||||
|
||||
return (mod_remove(&modlinkage));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user