Skip to content

Commit

Permalink
tpm: fix the return code, if the eventlog buffer is full
Browse files Browse the repository at this point in the history
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 97707f1 ("tpm: Support boot measurements")
Reviewed-by: Heinrich Schuchardt <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Signed-off-by: Ilias Apalodimas <[email protected]>
  • Loading branch information
apalos committed Jun 24, 2024
1 parent fe2ce09 commit 27d4966
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tpm-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 27d4966

Please sign in to comment.