aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.vnet.ibm.com>2018-03-19 12:00:29 -0400
committerKevin O'Connor <kevin@koconnor.net>2018-03-21 10:35:54 -0400
commit4922d6cb391b8ea48a35a73c46e484cf5f1a9b1a (patch)
treee152bd07fceab14a05203c5aa3e56aebdbff31c0
parent8bd306e10ff6abfed6188ec0f6c2157002a52d66 (diff)
downloadseabios-4922d6cb391b8ea48a35a73c46e484cf5f1a9b1a.tar.gz
tpm: when CRB is active, select, lock it, and check addresses
Do not just indicate that the probing for the CRB interface was successful if we find it active. Instead, select it, lock it, and test the addresses for whether they can be used (must be 32 bit). Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
-rw-r--r--src/hw/tpm_drivers.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/hw/tpm_drivers.c b/src/hw/tpm_drivers.c
index 271f8d3a..bd971f75 100644
--- a/src/hw/tpm_drivers.c
+++ b/src/hw/tpm_drivers.c
@@ -395,9 +395,7 @@ static u32 crb_probe(void)
if ((ifaceid & 0xf) != 0xf) {
if ((ifaceid & 0xf) == 1) {
/* CRB is active */
- return 1;
- }
- if ((ifaceid & (1 << 14)) == 0) {
+ } else if ((ifaceid & (1 << 14)) == 0) {
/* CRB cannot be selected */
return 0;
}