tpm/tpm_crb: fix priv->cmd_size initialisation
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 20170619062717.39849-1-manuel.lauss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Jarkko Sakkinen
Reviewed-byQuoted 6 lines · Manuel Lauss
priv->cmd_sizeis 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 aa77ea0e43dc ("tpm/tpm_crb: cache cmd_size register value.").Signed-off-by Manuel Lauss <[email protected]>
Thanks.
/Jarkko
Quoted 26 lines
--- drivers/char/tpm/tpm_crb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/char/tpm/tpm_crb.c +3
-2@@ -515,11 +515,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;Signature · 1 line
2.13.1
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot