]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tpm: fix the return code, if the eventlog buffer is full
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Sat, 22 Jun 2024 14:35:37 +0000 (17:35 +0300)
committerIlias Apalodimas <ilias.apalodimas@linaro.org>
Mon, 24 Jun 2024 05:37:56 +0000 (08:37 +0300)
We currently return 'No space left on device' if the eventlong buffer
we allocated is not enough. On a similar check later on that function
during the call to tcg2_log_init() we return 'No buffer space
available'. So switch both error codes to -ENOBUFS since we are always
checking a buffer and not a device.

Fixes: commit 97707f12fdab ("tpm: Support boot measurements")
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
lib/tpm-v2.c

index a67daed2f3c1d3e1a5ea65b72aefb98e9f3bd99b..91526af33acb22b35cacc2051adf6353756c98ac 100644 (file)
@@ -554,7 +554,7 @@ int tcg2_log_prepare_buffer(struct udevice *dev, struct tcg2_event_log *elog,
                if (elog->log_size) {
                        if (log.found) {
                                if (elog->log_size < log.log_position)
-                                       return -ENOSPC;
+                                       return -ENOBUFS;
 
                                /*
                                 * Copy the discovered log into the user buffer