]> git.baikalelectronics.ru Git - kernel.git/commit
tpm/tpm_i2c_stm_st33: Fix potential bug in tpm_stm_i2c_send
authorChristophe Ricard <christophe.ricard@gmail.com>
Mon, 1 Dec 2014 18:32:46 +0000 (19:32 +0100)
committerPeter Huewe <peterhuewe@gmx.de>
Sat, 17 Jan 2015 13:00:06 +0000 (14:00 +0100)
commit563007a877ff6352ea782a516617b02cba7827fd
tree815a541987c5ee04350a0bb766d71bdaaca38abe
parent93b4bb1dd73ec2a03beefa8b3d1808bffe393c55
tpm/tpm_i2c_stm_st33: Fix potential bug in tpm_stm_i2c_send

When sending data in tpm_stm_i2c_send, each loop iteration send buf.
Send buf + i instead as the goal of this for loop is to send a number
of byte from buf that fit in burstcnt. Once those byte are sent, we are
supposed to send the next ones.

The driver was working because the burstcount value returns always the maximum size for a TPM
command or response. (0x800 for a command and 0x400 for a response).

Cc: stable@vger.kernel.org
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
drivers/char/tpm/tpm_i2c_stm_st33.c