mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 07:04:24 +00:00
char: tpm: fix error return code in tpm_cr50_i2c_tis_recv()
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.
Fixes: 3a253caaad
("char: tpm: add i2c driver for cr50")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
This commit is contained in:
parent
9d53913fad
commit
3d785d73b4
1 changed files with 1 additions and 0 deletions
|
@ -483,6 +483,7 @@ static int tpm_cr50_i2c_tis_recv(struct tpm_chip *chip, u8 *buf, size_t buf_len)
|
|||
expected = be32_to_cpup((__be32 *)(buf + 2));
|
||||
if (expected > buf_len) {
|
||||
dev_err(&chip->dev, "Buffer too small to receive i2c data\n");
|
||||
rc = -E2BIG;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue