linux/drivers/char/tpm
Joe Hattori 558e339b16 char: tpm: Fix possible memory leak in tpm_bios_measurements_open()
commit 5d8e2971e8 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: 9b01b53566 ("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-08-19 05:45:11 +02:00
..
eventlog char: tpm: Fix possible memory leak in tpm_bios_measurements_open() 2024-08-19 05:45:11 +02:00
st33zp24
Kconfig
Makefile
tpm1-cmd.c
tpm2-cmd.c
tpm2-space.c
tpm_atmel.c
tpm_atmel.h
tpm_crb.c tpm: tpm_crb: Add the missed acpi_put_table() to fix memory leak 2023-01-12 11:58:48 +01:00
tpm_ftpm_tee.c
tpm_ftpm_tee.h
tpm_i2c_atmel.c
tpm_i2c_infineon.c
tpm_i2c_nuvoton.c
tpm_ibmvtpm.c
tpm_ibmvtpm.h
tpm_infineon.c
tpm_nsc.c
tpm_ppi.c
tpm_tis_core.c tpm_tis: Resend command to recover from data transfer errors 2023-09-23 11:09:56 +02:00
tpm_tis_core.h tpm, tpm: Implement usage counter for locality 2023-05-11 23:00:19 +09:00
tpm_tis_i2c_cr50.c
tpm_tis_spi_cr50.c
tpm_tis_spi_main.c
tpm_tis_spi.h
tpm_tis_synquacer.c
tpm_tis.c tpm/tpm_tis: Disable interrupts for more Lenovo devices 2023-05-24 17:36:55 +01:00
tpm_vtpm_proxy.c tpm: tpm_vtpm_proxy: fix a race condition in /dev/vtpmx creation 2023-07-23 13:47:47 +02:00
tpm-chip.c
tpm-dev-common.c
tpm-dev.c
tpm-dev.h
tpm-interface.c
tpm-sysfs.c
tpm.h
tpmrm-dev.c
xen-tpmfront.c