diff options
author | Anthony Scarpino <Anthony.Scarpino@Sun.COM> | 2010-02-23 13:34:52 -0800 |
---|---|---|
committer | Anthony Scarpino <Anthony.Scarpino@Sun.COM> | 2010-02-23 13:34:52 -0800 |
commit | d3b2efc749bec3b757d5f018cf78c9a09fa29cb3 (patch) | |
tree | 2d3e389ca2be51b8fe1e4aed7072e59681fd52e2 /usr/src/uts/common/crypto/io/md4_mod.c | |
parent | 76fa7285ab719293f713601f68497677a82ce6f9 (diff) | |
download | illumos-gate-d3b2efc749bec3b757d5f018cf78c9a09fa29cb3.tar.gz |
6849769 crypto modules _init: crypto_register_provider() failed during shutdown
6885135 assertion failed: kcf_dh != NULL
6907099 module load/unload errors could be a little less techie and ominous
Diffstat (limited to 'usr/src/uts/common/crypto/io/md4_mod.c')
-rw-r--r-- | usr/src/uts/common/crypto/io/md4_mod.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/usr/src/uts/common/crypto/io/md4_mod.c b/usr/src/uts/common/crypto/io/md4_mod.c index 8fb8fdd622..b574a0df39 100644 --- a/usr/src/uts/common/crypto/io/md4_mod.c +++ b/usr/src/uts/common/crypto/io/md4_mod.c @@ -20,10 +20,9 @@ */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" /* * In kernel module, the md4 module is created with one modlinkage, @@ -165,16 +164,10 @@ _init(void) if ((ret = mod_install(&modlinkage)) != 0) return (ret); - /* - * Register with KCF. If the registration fails, log an - * error and uninstall the module. - */ - if ((ret = crypto_register_provider(&md4_prov_info, - &md4_prov_handle)) != CRYPTO_SUCCESS) { - cmn_err(CE_WARN, "md4 _init: " - "crypto_register_provider() failed (0x%x)", ret); + /* Register with KCF. If the registration fails, remove the module. */ + if (crypto_register_provider(&md4_prov_info, &md4_prov_handle)) { (void) mod_remove(&modlinkage); - return (ret); + return (EACCES); } return (0); @@ -183,18 +176,11 @@ _init(void) int _fini(void) { - int ret; - - /* - * Unregister from KCF if previous registration succeeded. - */ + /* Unregister from KCF if module is registered */ if (md4_prov_handle != NULL) { - if ((ret = crypto_unregister_provider(md4_prov_handle)) != - CRYPTO_SUCCESS) { - cmn_err(CE_WARN, "md4 _fini: " - "crypto_unregister_provider() failed (0x%x)", ret); + if (crypto_unregister_provider(md4_prov_handle)) return (EBUSY); - } + md4_prov_handle = NULL; } |