Commit f128480f authored by Manuel Lauss's avatar Manuel Lauss Committed by James Morris

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: aa77ea0e ("tpm/tpm_crb: cache cmd_size register value.").
Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: default avatarJames Morris <james.l.morris@oracle.com>
parent 13b47cfc
...@@ -514,11 +514,12 @@ static int crb_map_io(struct acpi_device *device, struct crb_priv *priv, ...@@ -514,11 +514,12 @@ static int crb_map_io(struct acpi_device *device, struct crb_priv *priv,
goto out; goto out;
} }
priv->cmd_size = cmd_size;
priv->rsp = priv->cmd; priv->rsp = priv->cmd;
out: out:
if (!ret)
priv->cmd_size = cmd_size;
crb_go_idle(dev, priv); crb_go_idle(dev, priv);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment