diff --git a/p11-kit/add-profile.c b/p11-kit/add-profile.c index 0880ec1c..bf0e64a8 100644 --- a/p11-kit/add-profile.c +++ b/p11-kit/add-profile.c @@ -116,12 +116,7 @@ add_profile (const char *token_str, p11_message (_("failed to obtain module")); goto cleanup; } - slot = p11_kit_iter_get_slot (iter); - if (slot == 0) { - p11_message (_("failed to obtain slot")); - goto cleanup; - } rv = module->C_OpenSession (slot, CKF_SERIAL_SESSION | CKF_RW_SESSION, NULL, NULL, &session); if (rv != CKR_OK) { diff --git a/p11-kit/generate-keypair.c b/p11-kit/generate-keypair.c index a6c3eaf8..4b047a6a 100644 --- a/p11-kit/generate-keypair.c +++ b/p11-kit/generate-keypair.c @@ -300,12 +300,7 @@ generate_keypair (const char *token_str, p11_message (_("failed to obtain module")); goto cleanup; } - slot = p11_kit_iter_get_slot (iter); - if (slot == 0) { - p11_message (_("failed to obtain slot")); - goto cleanup; - } rv = module->C_OpenSession (slot, CKF_SERIAL_SESSION | CKF_RW_SESSION, NULL, NULL, &session); if (rv != CKR_OK) {