diff options
-rw-r--r-- | src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-tpm2.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-tpm2.c b/src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-tpm2.c index 7e958a4db5..abe80720af 100644 --- a/src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-tpm2.c +++ b/src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-tpm2.c @@ -24,13 +24,10 @@ _public_ const char *cryptsetup_token_version(void) { } static int log_debug_open_error(struct crypt_device *cd, int r) { - if (r == -EAGAIN) { - crypt_log_debug(cd, "TPM2 device not found."); - return r; - } else if (r == -ENXIO) { - crypt_log_debug(cd, "No matching TPM2 token data found."); - return r; - } + if (r == -EAGAIN) + return crypt_log_debug_errno(cd, r, "TPM2 device not found."); + if (r == -ENXIO) + return crypt_log_debug_errno(cd, r, "No matching TPM2 token data found."); return crypt_log_debug_errno(cd, r, TOKEN_NAME " open failed: %m."); } |