summaryrefslogtreecommitdiff
path: root/include/linux/tpm_eventlog.h
diff options
context:
space:
mode:
authorGregory Price <gourry@gourry.net>2024-09-13 19:19:53 -0400
committerArd Biesheuvel <ardb@kernel.org>2024-10-15 20:27:29 +0200
commita066397e8ed1036e8b959050ab6e830ee90d9f58 (patch)
treeb04c8fb1030b4478688e302815729d265d3b55a9 /include/linux/tpm_eventlog.h
parentc33c28f9f6e017702374e1ab907dfa5a63db5301 (diff)
tpm: fix unsigned/signed mismatch errors related to __calc_tpm2_event_size
__calc_tpm2_event_size returns 0 or a positive length, but return values are often interpreted as ints. Convert everything over to u32 to avoid signed/unsigned logic errors. Signed-off-by: Gregory Price <gourry@gourry.net> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'include/linux/tpm_eventlog.h')
-rw-r--r--include/linux/tpm_eventlog.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/tpm_eventlog.h b/include/linux/tpm_eventlog.h
index 7d68a5cc5881..891368e82558 100644
--- a/include/linux/tpm_eventlog.h
+++ b/include/linux/tpm_eventlog.h
@@ -157,7 +157,7 @@ struct tcg_algorithm_info {
* Return: size of the event on success, 0 on failure
*/
-static __always_inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event,
+static __always_inline u32 __calc_tpm2_event_size(struct tcg_pcr_event2_head *event,
struct tcg_pcr_event *event_header,
bool do_mapping)
{