kernel_samsung_a53x/drivers/char/tpm
Joe Hattori 5100645222 char: tpm: Fix possible memory leak in tpm_bios_measurements_open()
commit 5d8e2971e817bb64225fc0b6327a78752f58a9aa upstream.

In tpm_bios_measurements_open(), get_device() is called on the device
embedded in struct tpm_chip. In the error path, however, put_device() is
not called. This results in a reference count leak, which prevents the
device from being properly released. This commit makes sure to call
put_device() when the seq_open() call fails.

Cc: stable@vger.kernel.org # +v4.18
Fixes: 9b01b5356629 ("tpm: Move shared eventlog functions to common.c")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-23 23:20:12 +01:00
..
eventlog char: tpm: Fix possible memory leak in tpm_bios_measurements_open() 2024-11-23 23:20:12 +01:00
st33zp24 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm-chip.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm-dev-common.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm-dev.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm-dev.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm-interface.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm-sysfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm1-cmd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm2-cmd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm2-space.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_atmel.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_atmel.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_crb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_ftpm_tee.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_ftpm_tee.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_i2c_atmel.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_i2c_infineon.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_i2c_nuvoton.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_ibmvtpm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_ibmvtpm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_infineon.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_nsc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_ppi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_tis.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_tis_core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_tis_core.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_tis_spi.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_tis_spi_cr50.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_tis_spi_main.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_tis_synquacer.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm_vtpm_proxy.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpmrm-dev.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xen-tpmfront.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00