tpm: Fix alignment of buf->handles
Subsystems (5)
Jarkko Sakkinen
maintainerPATCH 1/1 tpm: Fix alignment of buf->handles
tpm_buf_append_name() has the following snippet in the beginning:
if (!tpm2_chip_auth(chip)) {
tpm_buf_append_u32(buf, handle);
/* count the number of handles in the upper bits of flags */
buf->handles++;
return;
}The claim in the comment is wrong, and the comment is in the wrong place as it should not be anyway a concern of the "call site". So in essence it is lying about the code.
Fix the alignment to be aligned with the claim in the comment and remove the comment.
Cc [email protected] # v6.10+
Fixes 699e3efd6c64 ("tpm: Add HMAC session start and end functions")
Signed-off-by Jarkko Sakkinen <[email protected]>
--- drivers/char/tpm/tpm2-sessions.c | 1 - include/linux/tpm.h | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/char/tpm/tpm2-sessions.c +0 -1
@@ -238,7 +238,6 @@ void tpm_buf_append_name(struct tpm_chip *chip, struct tpm_buf *buf,if (!tpm2_chip_auth (chip)) {tpm_buf_append_u32 (buf, handle); -/* count the number of handles in the upper bits of flags */ buf->handles++;return ; }
include/linux/tpm.h +2 -2
@@ -374,10 +374,10 @@ enum tpm_buf_flags {* A string buffer type for constructing TPM commands. */ struct tpm_buf { -u32 flags; +u16 flags; +u16 handles;u32 length;u8 *data; -u8 handles; };enum tpm2_object_attributes {
Signature · 1 line
2.45.2