1
0
Fork 0

tpm/tpm_crb: fix priv->cmd_size initialisation

priv->cmd_size is never initialised if the cmd and rsp buffers reside
at different addresses.  Initialise it in the exit path of the function
when rsp buffer has also been successfully allocated.

Fixes: aa77ea0e43 ("tpm/tpm_crb: cache cmd_size register value.").
Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
zero-colors
Manuel Lauss 2017-06-19 08:27:17 +02:00 committed by James Morris
parent 13b47cfcfc
commit f128480f39
1 changed files with 3 additions and 2 deletions

View File

@ -514,11 +514,12 @@ static int crb_map_io(struct acpi_device *device, struct crb_priv *priv,
goto out;
}
priv->cmd_size = cmd_size;
priv->rsp = priv->cmd;
out:
if (!ret)
priv->cmd_size = cmd_size;
crb_go_idle(dev, priv);
return ret;