diff options
author | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | 2017-09-13 13:04:35 -0400 |
---|---|---|
committer | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | 2017-10-18 11:28:48 -0400 |
commit | 4557d4bedc9c4c51201a8e802a6671ed8dfc0f41 (patch) | |
tree | 43cb5ce1da2326094a87a8bcaff6d9c1a0cb36fe /drivers | |
parent | 171360d7800c19622dbdaf202ed6f48ff24a5ae2 (diff) |
tpm: fix type of a local variable in tpm2_map_command()
The local variable 'handle' should have the type __be32 instead of u32.
Fixes: 745b361e989a ("tpm: infrastructure for TPM spaces")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/tpm/tpm2-space.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/tpm/tpm2-space.c b/drivers/char/tpm/tpm2-space.c index e2e059d8ffec..4e4014eabdb9 100644 --- a/drivers/char/tpm/tpm2-space.c +++ b/drivers/char/tpm/tpm2-space.c | |||
@@ -242,7 +242,7 @@ static int tpm2_map_command(struct tpm_chip *chip, u32 cc, u8 *cmd) | |||
242 | struct tpm_space *space = &chip->work_space; | 242 | struct tpm_space *space = &chip->work_space; |
243 | unsigned int nr_handles; | 243 | unsigned int nr_handles; |
244 | u32 attrs; | 244 | u32 attrs; |
245 | u32 *handle; | 245 | __be32 *handle; |
246 | int i; | 246 | int i; |
247 | 247 | ||
248 | i = tpm2_find_cc(chip, cc); | 248 | i = tpm2_find_cc(chip, cc); |
@@ -252,7 +252,7 @@ static int tpm2_map_command(struct tpm_chip *chip, u32 cc, u8 *cmd) | |||
252 | attrs = chip->cc_attrs_tbl[i]; | 252 | attrs = chip->cc_attrs_tbl[i]; |
253 | nr_handles = (attrs >> TPM2_CC_ATTR_CHANDLES) & GENMASK(2, 0); | 253 | nr_handles = (attrs >> TPM2_CC_ATTR_CHANDLES) & GENMASK(2, 0); |
254 | 254 | ||
255 | handle = (u32 *)&cmd[TPM_HEADER_SIZE]; | 255 | handle = (__be32 *)&cmd[TPM_HEADER_SIZE]; |
256 | for (i = 0; i < nr_handles; i++, handle++) { | 256 | for (i = 0; i < nr_handles; i++, handle++) { |
257 | if ((be32_to_cpu(*handle) & 0xFF000000) == TPM2_HT_TRANSIENT) { | 257 | if ((be32_to_cpu(*handle) & 0xFF000000) == TPM2_HT_TRANSIENT) { |
258 | if (!tpm2_map_to_phandle(space, handle)) | 258 | if (!tpm2_map_to_phandle(space, handle)) |