VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Zhihao Cheng <chengzhihao1@huawei.com> 2021-04-09 09:12:01 +0800 committer: Jarkko Sakkinen <jarkko@kernel.org> 2021-04-14 16:30:30 +0300 commit: 3d785d73b4c1014839d9f9af0ee526f8d5706a73 parent: 9d53913fad3ee800d0067c39881a86a5eb739ae3
Commit Summary:
char: tpm: fix error return code in tpm_cr50_i2c_tis_recv()
Diffstat:
1 file changed, 1 insertion, 0 deletions
diff --git a/drivers/char/tpm/tpm_tis_i2c_cr50.c b/drivers/char/tpm/tpm_tis_i2c_cr50.c
index ec9a65e7887d..f19c227d20f4 100644
--- a/drivers/char/tpm/tpm_tis_i2c_cr50.c
+++ b/drivers/char/tpm/tpm_tis_i2c_cr50.c
@@ -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;
 	}