From: Stefan Berger Date: Mon, 19 Mar 2018 16:00:29 +0000 (-0400) Subject: tpm: when CRB is active, select, lock it, and check addresses X-Git-Tag: rel-1.12.0~25 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4922d6cb391b8ea48a35a73c46e484cf5f1a9b1a;p=people%2Fandrewcoop%2Fseabios.git 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 --- diff --git a/src/hw/tpm_drivers.c b/src/hw/tpm_drivers.c index 271f8d3..bd971f7 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; }