From: Lennart Poettering Date: Tue, 1 Jun 2021 14:17:24 +0000 (+0200) Subject: cryptsetup: add missing error branch X-Git-Tag: v249-rc1~120 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=abc50cf6c8bfc98acc0b5cdc33b731f8fd1c37d6;p=thirdparty%2Fsystemd.git cryptsetup: add missing error branch Found in the process of trying to figure out #19193, but I doubt it's going to fix that. --- diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index 28ac78cd378..a2178544cf8 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);