Skip to content
Commit 5d8e2971 authored by Joe Hattori's avatar Joe Hattori Committed by Jarkko Sakkinen
Browse files

char: tpm: Fix possible memory leak in tpm_bios_measurements_open()



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: 9b01b535 ("tpm: Move shared eventlog functions to common.c")
Signed-off-by: default avatarJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
parent 22a40d14
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment