Skip to content

Commit 49afd72

Browse files
Jarkko SakkinenPeterHuewe
authored andcommitted
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 <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]> Reviewed-By: Jason Gunthorpe <[email protected]> Cc: <[email protected]> Fixes: 30fc8d1 ("tpm: TPM 2.0 CRB Interface") Signed-off-by: Peter Huewe <[email protected]>
1 parent 9d75f08 commit 49afd72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/char/tpm/tpm_crb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ static int crb_acpi_add(struct acpi_device *device)
267267

268268
memcpy_fromio(&pa, &priv->cca->cmd_pa, 8);
269269
pa = le64_to_cpu(pa);
270-
priv->cmd = devm_ioremap_nocache(dev, le64_to_cpu(pa),
270+
priv->cmd = devm_ioremap_nocache(dev, pa,
271271
ioread32(&priv->cca->cmd_size));
272272
if (!priv->cmd) {
273273
dev_err(dev, "ioremap of the command buffer failed\n");
@@ -276,7 +276,7 @@ static int crb_acpi_add(struct acpi_device *device)
276276

277277
memcpy_fromio(&pa, &priv->cca->rsp_pa, 8);
278278
pa = le64_to_cpu(pa);
279-
priv->rsp = devm_ioremap_nocache(dev, le64_to_cpu(pa),
279+
priv->rsp = devm_ioremap_nocache(dev, pa,
280280
ioread32(&priv->cca->rsp_size));
281281
if (!priv->rsp) {
282282
dev_err(dev, "ioremap of the response buffer failed\n");

0 commit comments

Comments
 (0)