summaryrefslogtreecommitdiffstats
path: root/src/pcrextend
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-04-22 09:46:23 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2024-04-22 12:40:09 +0200
commit21a3bc6b9f01c3b0bf906c0b28f8827db086edf8 (patch)
tree09615be569defc4752fbc2439b01d4fe61d5c41c /src/pcrextend
parentsd-event: fix fd leak when fd is owned by IO event source (diff)
downloadsystemd-21a3bc6b9f01c3b0bf906c0b28f8827db086edf8.tar.xz
systemd-21a3bc6b9f01c3b0bf906c0b28f8827db086edf8.zip
tpm2-util: add generic wrapper tpm2_context_new_or_warn() that wrpas tpm2_context_new and logs about errors
We so far just print a short log message that is not very useful, let's add some recognizable error codes, and output better log messages if we can't get TPM stuff to work. Fixes: #31925
Diffstat (limited to 'src/pcrextend')
-rw-r--r--src/pcrextend/pcrextend.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pcrextend/pcrextend.c b/src/pcrextend/pcrextend.c
index ead353f5a6..ba2b171250 100644
--- a/src/pcrextend/pcrextend.c
+++ b/src/pcrextend/pcrextend.c
@@ -199,7 +199,7 @@ static int extend_now(unsigned pcr, const void *data, size_t size, Tpm2Userspace
_cleanup_(tpm2_context_unrefp) Tpm2Context *c = NULL;
int r;
- r = tpm2_context_new(arg_tpm2_device, &c);
+ r = tpm2_context_new_or_warn(arg_tpm2_device, &c);
if (r < 0)
return r;