linux/drivers/char
Harshit Mogalapalli 6b301ded45 tpm: Fix a possible dereference of ERR_PTR in tpm_init()
Smatch reports:
	drivers/char/tpm/tpm-interface.c:470 tpm_init() error:
	'tpm_class' dereferencing possible ERR_PTR()

If class_create() returns error pointer, we are dereferencing a possible
error pointer. Fix this by moving the dereference post error handling.

Fixes: a010eb8812 ("tpm: fix up the tpm_class shutdown_pre pointer when created")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Link: https://lore.kernel.org/r/20230321061416.626561-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-21 09:00:08 +01:00
..
agp char/agp: consolidate {alloc,free}_gatt_pages() 2023-02-13 22:13:12 +01:00
hw_random hwrng: starfive - Enable compile testing 2023-02-03 12:55:59 +08:00
ipmi driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
mwave char/mwave: Adjust io port register size 2021-12-03 14:27:06 +01:00
pcmcia driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
tpm tpm: Fix a possible dereference of ERR_PTR in tpm_init() 2023-03-21 09:00:08 +01:00
xilinx_hwicap driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
xillybus driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
adi.c
apm-emulation.c apm-emulation: drop unexpected word "the" in the comments 2022-06-27 16:15:27 +02:00
applicom.c applicom: Fix PCI device refcount leak in applicom_init() 2023-01-20 13:05:39 +01:00
applicom.h
bsr.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
ds1620.c
dsp56k.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
dtlk.c
hangcheck-timer.c
hpet.c hpet: remove unused writeq/readq function definitions 2022-02-04 16:45:39 +01:00
Kconfig random: use random.trust_{bootloader,cpu} command line option only 2022-11-18 02:18:10 +01:00
lp.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
Makefile char: remove VR41XX related char driver 2022-07-28 16:12:33 +02:00
mem.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
misc.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
mspec.c mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
nsc_gpio.c
nvram.c
nwbutton.c
nwbutton.h
nwflash.c
pc8736x_gpio.c
powernv-op-panel.c powerpc/powernv: Fix fall-through warning for Clang 2021-07-13 19:21:41 -05:00
ppdev.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
ps3flash.c
random.c random: do not include <asm/archrandom.h> from random.h 2022-12-20 03:13:45 +01:00
scx200_gpio.c
sonypi.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
tlclk.c
toshiba.c
ttyprintk.c char: ttyprintk: register console 2022-04-22 16:24:47 +02:00
uv_mmtimer.c
virtio_console.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00