From: Heinrich Schuchardt Date: Sat, 11 Nov 2023 00:35:30 +0000 (+0100) Subject: tpm: remove superfluous check in tpm_tis_send() X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=9086e8f04d268a989193470de7cc14e4a577e6f5;p=u-boot.git 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 Reviewed-by: Ilias Apalodimas Reviewed-by: Simon Glass Signed-off-by: Ilias Apalodimas --- diff --git a/drivers/tpm/tpm2_tis_core.c b/drivers/tpm/tpm2_tis_core.c index 985a816219..81b9210056 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;