diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2022-04-26 11:06:02 +0300 |
---|---|---|
committer | Jarkko Sakkinen <jarkko@kernel.org> | 2022-05-23 18:47:49 +0300 |
commit | e0687fe958f763f1790f22ed5483025b7624e744 (patch) | |
tree | 8d1b95f8701e4f143fff20de77ffcdba6dcc880e /drivers/char/dtlk.c | |
parent | 9c438fdef8906fe9c025e0106cef6fe491728790 (diff) | |
download | linux-e0687fe958f763f1790f22ed5483025b7624e744.tar.xz |
char: tpm: cr50_i2c: Suppress duplicated error message in .remove()
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>
Diffstat (limited to 'drivers/char/dtlk.c')
0 files changed, 0 insertions, 0 deletions