]> git.proxmox.com Git - mirror_qemu.git/commitdiff
tpm_tis: fix loop that cancels any seizure by a lower locality
authorLiam Merwick <liam.merwick@oracle.com>
Fri, 15 Feb 2019 13:35:17 +0000 (13:35 +0000)
committerStefan Berger <stefanb@linux.vnet.ibm.com>
Sun, 24 Feb 2019 19:46:14 +0000 (14:46 -0500)
In tpm_tis_mmio_write() if the requesting locality is seizing
access, any seizure by a lower locality is cancelled.  However the
loop doing the seizure had an off-by-one error and the locality
immediately preceding the requesting locality was not being cleared.
This is fixed by adjusting the test in the for loop to check the
localities up to the requesting locality.

Signed-off-by: Liam Merwick <Liam.Merwick@oracle.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
hw/tpm/tpm_tis.c

index fd6bb9b59a96a27324d4fb48ab143d91ec70225e..61a130beef358b1537f98a1708b48b9489abadfc 100644 (file)
@@ -624,7 +624,7 @@ static void tpm_tis_mmio_write(void *opaque, hwaddr addr,
                 }
 
                 /* cancel any seize by a lower locality */
-                for (l = 0; l < locty - 1; l++) {
+                for (l = 0; l < locty; l++) {
                     s->loc[l].access &= ~TPM_TIS_ACCESS_SEIZE;
                 }