]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cryptsetup: add missing error branch
authorLennart Poettering <lennart@poettering.net>
Tue, 1 Jun 2021 14:17:24 +0000 (16:17 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 1 Jun 2021 16:04:06 +0000 (18:04 +0200)
Found in the process of trying to figure out #19193, but I doubt it's
going to fix that.

src/cryptsetup/cryptsetup.c

index 28ac78cd3783612bb1674998b2b206d775f29d01..a2178544cf84f2f6575146912f95934b8889c8da 100644 (file)
@@ -1245,6 +1245,8 @@ static int attach_luks_or_plain_or_bitlk_by_key_file(
                 log_error_errno(r, "Failed to activate, key file '%s' missing.", key_file);
                 return -EAGAIN; /* Log actual error, but return EAGAIN */
         }
+        if (r < 0)
+                return log_error_errno(r, "Failed to read key file '%s': %m", key_file);
 
         if (pass_volume_key)
                 r = crypt_activate_by_volume_key(cd, name, kfdata, kfsize, flags);