Skip to content

Commit b09d530

Browse files
Kylene Jo HallLinus Torvalds
authored andcommitted
[PATCH] tpm: check mem start and len
The memory start and length values obtained from the ACPI entry need to be checked and filled in with the default values from the specification if they don't exist. This patch fills in the default values and uses them appropriately. Signed-off-by: Kylie Hall <kjhall@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent e496f54 commit b09d530

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/char/tpm/tpm_tis.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ enum tis_int_flags {
5252
};
5353

5454
enum tis_defaults {
55+
TIS_MEM_BASE = 0xFED4000,
56+
TIS_MEM_LEN = 0x5000,
5557
TIS_SHORT_TIMEOUT = 750, /* ms */
5658
TIS_LONG_TIMEOUT = 2000, /* 2 sec */
5759
};
@@ -437,6 +439,11 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev
437439
start = pnp_mem_start(pnp_dev, 0);
438440
len = pnp_mem_len(pnp_dev, 0);
439441

442+
if (!start)
443+
start = TIS_MEM_BASE;
444+
if (!len)
445+
len = TIS_MEM_LEN;
446+
440447
if (!(chip = tpm_register_hardware(&pnp_dev->dev, &tpm_tis)))
441448
return -ENODEV;
442449

0 commit comments

Comments
 (0)