mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 01:13:11 +00:00
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>