From abc50cf6c8bfc98acc0b5cdc33b731f8fd1c37d6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 1 Jun 2021 16:17:24 +0200 Subject: [PATCH] cryptsetup: add missing error branch Found in the process of trying to figure out #19193, but I doubt it's going to fix that. --- src/cryptsetup/cryptsetup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index 28ac78cd37..a2178544cf 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -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); -- 2.25.1