Skip to content

Commit

Permalink
Fixing ICP memleak introduced in openzfs#4760
Browse files Browse the repository at this point in the history
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 openzfs#4760 was merged, resulting in leaks.
This patch simply fixes that.
  • Loading branch information
Tom Caputi committed Oct 11, 2016
1 parent 8c8cf8a commit dd33105
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions module/icp/io/skein_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit dd33105

Please sign in to comment.