aboutsummaryrefslogtreecommitdiff
path: root/drivers/tpm
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-11-11 01:35:30 +0100
committerIlias Apalodimas <ilias.apalodimas@linaro.org>2023-11-22 10:03:55 +0200
commit9086e8f04d268a989193470de7cc14e4a577e6f5 (patch)
tree777e239aa1fa5f9f3546df054f978282ea4e29f3 /drivers/tpm
parentdca7a8958f8d0dbd53072caa4353353e062d80ca (diff)
downloadu-boot-9086e8f04d268a989193470de7cc14e4a577e6f5.zip
u-boot-9086e8f04d268a989193470de7cc14e4a577e6f5.tar.gz
u-boot-9086e8f04d268a989193470de7cc14e4a577e6f5.tar.bz2
tpm: remove superfluous check in tpm_tis_send()
Checking if variable chip is NULL after dereferencing it makes no sense. As discribed in [1] it is not expected that the variable can ever be NULL. [1] Re: [PATCH] tpm: avoid NULL pointer dereference in tpm_tis_send() https://lore.kernel.org/u-boot/YaFwDtKKYRr7qzWc@apalos.home/ Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'drivers/tpm')
-rw-r--r--drivers/tpm/tpm2_tis_core.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/tpm/tpm2_tis_core.c b/drivers/tpm/tpm2_tis_core.c
index 985a816..81b9210 100644
--- a/drivers/tpm/tpm2_tis_core.c
+++ b/drivers/tpm/tpm2_tis_core.c
@@ -224,9 +224,6 @@ int tpm_tis_send(struct udevice *dev, const u8 *buf, size_t len)
u8 status;
int ret;
- if (!chip)
- return -ENODEV;
-
ret = tpm_tis_request_locality(dev, 0);
if (ret < 0)
return -EBUSY;