WSL2-Linux-Kernel/drivers/char
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
..
agp parisc/agp: Annotate parisc agp init functions with __init 2021-12-17 10:30:15 +01:00
hw_random random: pull add_hwgenerator_randomness() declaration into random.h 2022-05-30 09:29:09 +02:00
ipmi ipmi: Fix pr_fmt to avoid compilation issues 2022-06-09 10:22:37 +02:00
mwave char/mwave: Adjust io port register size 2022-01-27 11:04:09 +01:00
pcmcia
tpm char: tpm: cr50_i2c: Suppress duplicated error message in .remove() 2022-06-09 10:22:40 +02:00
xilinx_hwicap
xillybus
Kconfig random: treat bootloader trust toggle the same way as cpu trust toggle 2022-05-30 09:29:11 +02:00
Makefile
adi.c
apm-emulation.c
applicom.c
applicom.h
bsr.c
ds1620.c
dsp56k.c
dtlk.c
hangcheck-timer.c
hpet.c
lp.c
mem.c
misc.c
mspec.c
nsc_gpio.c
nvram.c
nwbutton.c
nwbutton.h
nwflash.c
pc8736x_gpio.c
powernv-op-panel.c
ppdev.c
ps3flash.c
random.c crypto: drbg - make reseeding from get_random_bytes() synchronous 2022-06-06 08:43:38 +02:00
scx200_gpio.c
sonypi.c
tb0219.c
tlclk.c
toshiba.c
ttyprintk.c
uv_mmtimer.c
virtio_console.c virtio_console: eliminate anonymous module_init & module_exit 2022-04-13 20:59:13 +02:00