diff --git a/usr/lib/pkcs11/common/new_host.c b/usr/lib/pkcs11/common/new_host.c index 2155e38d..6e4a8962 100755 --- a/usr/lib/pkcs11/common/new_host.c +++ b/usr/lib/pkcs11/common/new_host.c @@ -756,6 +756,9 @@ CK_RV SC_Finalize( CK_SLOT_ID sid ) session_mgr_close_all_sessions(); object_mgr_purge_token_objects(); detach_shm(); + // close spin lock file + if (spin_created) + close(spinxplfd); if ( token_specific.t_final != NULL) { token_specific.t_final(); } diff --git a/usr/lib/pkcs11/tpm_stdll/new_host.c b/usr/lib/pkcs11/tpm_stdll/new_host.c index 33694d7b..f65d7083 100644 --- a/usr/lib/pkcs11/tpm_stdll/new_host.c +++ b/usr/lib/pkcs11/tpm_stdll/new_host.c @@ -549,6 +549,9 @@ CK_RV SC_Finalize( CK_SLOT_ID sid ) object_mgr_purge_token_objects(); detach_shm(); + // close spin lock file + if (spin_created) + close(spinxplfd); if ( token_specific.t_final != NULL) { token_specific.t_final(); }