summaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm
diff options
context:
space:
mode:
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2015-06-09 08:07:59 -0400
committerPeter Huewe <peterhuewe@gmx.de>2015-06-16 17:27:16 -0400
commit49afd7289bd937401c5f7faa193054bc3c41dad6 (patch)
tree0744d4332e88262fe8ef61f427257e21860f74b5 /drivers/char/tpm
parent9d75f08946e8485109458ccf16f714697c207f41 (diff)
tpm, tpm_crb: fix le64_to_cpu conversions in crb_acpi_add()
le64_to_cpu() was applied twice to the physical addresses read from the control area. This hasn't shown any visible regressions because CRB driver has been tested only on the little endian platofrms so far. Reported-by: Matt Fleming <matt.fleming@intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Reviewed-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Cc: <stable@vger.kernel.org> Fixes: 30fc8d138e91 ("tpm: TPM 2.0 CRB Interface") Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Diffstat (limited to 'drivers/char/tpm')
-rw-r--r--drivers/char/tpm/tpm_crb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
index b26ceee3585e..44f9d20c19ac 100644
--- a/drivers/char/tpm/tpm_crb.c
+++ b/drivers/char/tpm/tpm_crb.c
@@ -267,7 +267,7 @@ static int crb_acpi_add(struct acpi_device *device)
267 267
268 memcpy_fromio(&pa, &priv->cca->cmd_pa, 8); 268 memcpy_fromio(&pa, &priv->cca->cmd_pa, 8);
269 pa = le64_to_cpu(pa); 269 pa = le64_to_cpu(pa);
270 priv->cmd = devm_ioremap_nocache(dev, le64_to_cpu(pa), 270 priv->cmd = devm_ioremap_nocache(dev, pa,
271 ioread32(&priv->cca->cmd_size)); 271 ioread32(&priv->cca->cmd_size));
272 if (!priv->cmd) { 272 if (!priv->cmd) {
273 dev_err(dev, "ioremap of the command buffer failed\n"); 273 dev_err(dev, "ioremap of the command buffer failed\n");
@@ -276,7 +276,7 @@ static int crb_acpi_add(struct acpi_device *device)
276 276
277 memcpy_fromio(&pa, &priv->cca->rsp_pa, 8); 277 memcpy_fromio(&pa, &priv->cca->rsp_pa, 8);
278 pa = le64_to_cpu(pa); 278 pa = le64_to_cpu(pa);
279 priv->rsp = devm_ioremap_nocache(dev, le64_to_cpu(pa), 279 priv->rsp = devm_ioremap_nocache(dev, pa,
280 ioread32(&priv->cca->rsp_size)); 280 ioread32(&priv->cca->rsp_size));
281 if (!priv->rsp) { 281 if (!priv->rsp) {
282 dev_err(dev, "ioremap of the response buffer failed\n"); 282 dev_err(dev, "ioremap of the response buffer failed\n");