Skip to contentSkip to conversation

tpm: Fix the type of the return value in calc_tpm2_event_size()

PATCH Applied Jarkko Sakkinen 2 participants 2 messages Apr 23, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tpm: Fix the type of the return value in calc_tpm2_event_size()

From: Yue Haibing <[email protected]>

commit b9d0a85d6b2e76630cfd4c475ee3af4109bfd87a upstream

calc_tpm2_event_size() has an invalid signature because it returns a 'size_t' where as its signature says that it returns 'int'.

Fixes 4d23cc323cdb ("tpm: add securityfs support for TPM 2.0 firmware event log")

---
for v5.0 and v4.19 stable
fixed compilation issue
fixed upstream commit ID

 drivers/char/tpm/eventlog/tpm2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/char/tpm/eventlog/tpm2.c +2 -2
index 1b8fa9de2cac..41b9f6c92da7 100644
@@ -37,8 +37,8 @@
  *
  * Returns size of the event. If it is an invalid event, returns 0.
  */
-static int calc_tpm2_event_size(struct tcg_pcr_event2 *event,
-				struct tcg_pcr_event *event_header)
+static size_t calc_tpm2_event_size(struct tcg_pcr_event2 *event,
+				   struct tcg_pcr_event *event_header)
 {
 	struct tcg_efi_specid_event *efispecid;
 	struct tcg_event_field *event_field;
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 8 lines · Jarkko Sakkinen

From: Yue Haibing <[email protected]>

commit b9d0a85d6b2e76630cfd4c475ee3af4109bfd87a upstream

calc_tpm2_event_size() has an invalid signature because it returns a 'size_t' where as its signature says that it returns 'int'.

Quoted 7 lines
Fixes 4d23cc323cdb ("tpm: add securityfs support for TPM 2.0 firmware event log")

Queued for 5.0 and 4.19, thanks!

--
Thanks,
Sasha