linux-stable/drivers/char/tpm
Uwe Kleine-König f8bd7f369b char: tpm: cr50_i2c: Suppress duplicated error message in .remove()
[ Upstream commit e0687fe958 ]

Returning an error value in an i2c remove callback results in an error
message being emitted by the i2c core, but otherwise it doesn't make a
difference. The device goes away anyhow and the devm cleanups are
called.

As tpm_cr50_i2c_remove() emits an error message already and the
additional error message by the i2c core doesn't add any useful
information, change the return value to zero to suppress this error
message.

Note that if i2c_clientdata is NULL, there is something really fishy.
Assuming no memory corruption happened (then all bets are lost anyhow),
tpm_cr50_i2c_remove() is only called after tpm_cr50_i2c_probe() returned
successfully. So there was a tpm chip registered before and after
tpm_cr50_i2c_remove() its privdata is freed but the associated character
device isn't removed. If after that happened userspace accesses the
character device it's likely that the freed memory is accessed. For that
reason the warning message is made a bit more frightening.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:22:40 +02:00
..
eventlog tpm: vtpm_proxy: Avoid reading host log when using a virtual device 2021-04-14 16:30:30 +03:00
st33zp24 tpm/st33zp24: fix spelling mistake "drescription" -> "description" 2020-07-02 17:49:00 +03:00
Kconfig char: tpm: Kconfig: remove bad i2c cr50 select 2021-08-23 19:55:42 +03:00
Makefile char: tpm: add i2c driver for cr50 2021-02-16 10:40:27 +02:00
tpm-chip.c tpm: fix reference counting for struct tpm_chip 2022-04-08 14:22:48 +02:00
tpm-dev-common.c tpm: Fix error handling in async work 2022-03-28 09:58:42 +02:00
tpm-dev.c
tpm-dev.h
tpm-interface.c tpm: fix wrong return value in tpm_pcr_extend 2020-04-21 00:06:13 +03:00
tpm-sysfs.c tpm: add sysfs exports for all banks of PCR registers 2021-02-16 10:40:27 +02:00
tpm.h tpm: fix reference counting for struct tpm_chip 2022-04-08 14:22:48 +02:00
tpm1-cmd.c tpm: fix some doc warnings in tpm1-cmd.c 2021-06-23 16:51:03 +03:00
tpm2-cmd.c tpm: Fix buffer access in tpm2_get_tpm_pt() 2022-06-06 08:43:41 +02:00
tpm2-space.c tpm: fix reference counting for struct tpm_chip 2022-04-08 14:22:48 +02:00
tpm_atmel.c
tpm_atmel.h
tpm_crb.c tpm_crb: Use IOMEM_ERR_PTR when function returns iomem 2021-06-23 16:51:03 +03:00
tpm_ftpm_tee.c tpm_ftpm_tee: Free and unregister TEE shared memory during kexec 2021-07-21 07:55:50 +02:00
tpm_ftpm_tee.h
tpm_i2c_atmel.c
tpm_i2c_infineon.c
tpm_i2c_nuvoton.c
tpm_ibmvtpm.c tpm: ibmvtpm: Correct the return value in tpm_ibmvtpm_probe() 2022-06-06 08:43:41 +02:00
tpm_ibmvtpm.h tpm: ibmvtpm: Avoid error message when process gets signal while waiting 2021-08-23 19:55:42 +03:00
tpm_infineon.c
tpm_nsc.c
tpm_ppi.c tpm/ppi: Constify static struct attribute_group 2021-02-16 10:40:27 +02:00
tpm_tis.c tpm_tis: Use DEFINE_RES_MEM() to simplify code 2021-06-23 16:51:03 +03:00
tpm_tis_core.c tpm: fix NPE on probe for missing device 2022-01-27 11:05:07 +01:00
tpm_tis_core.h tpm: fix Atmel TPM crash caused by too frequent queries 2021-11-18 19:16:41 +01:00
tpm_tis_i2c_cr50.c char: tpm: cr50_i2c: Suppress duplicated error message in .remove() 2022-06-09 10:22:40 +02:00
tpm_tis_spi.h
tpm_tis_spi_cr50.c tpm: tpm_tis_spi_cr50: use new structure for SPI transfer delays 2020-03-13 03:53:16 +02:00
tpm_tis_spi_main.c tpm_tis_spi: Add missing SPI ID 2021-11-18 19:16:41 +01:00
tpm_tis_synquacer.c tpm: tis: add support for MMIO TPM on SynQuacer 2020-10-02 00:21:02 +03:00
tpm_vtpm_proxy.c
tpmrm-dev.c tpm: Unify the mismatching TPM space buffer sizes 2020-07-24 09:26:23 +03:00
xen-tpmfront.c