Skip to content

Commit

Permalink
Don't check for slot == 0 as 0 is a valid slot ID
Browse files Browse the repository at this point in the history
Signed-off-by: Zoltan Fridrich <[email protected]>
  • Loading branch information
ZoltanFridrich committed Sep 22, 2023
1 parent 921aa29 commit 72c821b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
5 changes: 0 additions & 5 deletions p11-kit/add-profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 0 additions & 5 deletions p11-kit/generate-keypair.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 72c821b

Please sign in to comment.