]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cryptenroll: drop deadcode
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 Feb 2023 09:22:57 +0000 (18:22 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 10 Feb 2023 10:45:19 +0000 (10:45 +0000)
Follow-up for b0fc23fae51d244d2c33d70c10003aa5d5840223.

After the commit, 'signature_path' is now always non-NULL, hence the
condition can be dropped.

Fixes CID#1504492.

src/cryptenroll/cryptenroll-tpm2.c

index 658db6a523094eadf3fec7d556a7a9cbf7574297..1052321fdc8721158189257f0354d0b4205d08b7 100644 (file)
@@ -201,12 +201,8 @@ int enroll_tpm2(struct crypt_device *cd,
                  * This is optional however, skip it if it's not explicitly provided. */
 
                 r = tpm2_load_pcr_signature(signature_path, &signature_json);
-                if (r < 0) {
-                        if (signature_path || r != -ENOENT)
-                                return log_debug_errno(r, "Failed to read TPM PCR signature: %m");
-
-                        log_debug_errno(r, "Failed to read TPM2 PCR signature, proceeding without: %m");
-                }
+                if (r < 0)
+                        return log_debug_errno(r, "Failed to read TPM PCR signature: %m");
         }
 
         r = tpm2_seal(device,