Commit 5d8e297
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: [email protected] # +v4.18
Fixes: 9b01b53 ("tpm: Move shared eventlog functions to common.c")
Signed-off-by: Joe Hattori <[email protected]>
Signed-off-by: Jarkko Sakkinen <[email protected]>1 parent 22a40d1 commit 5d8e297
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
0 commit comments