Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tpm_tis: Do *not* flush uninitialized work

tpm_tis_core_init() may fail before tpm_tis_probe_irq_single() is
called, in which case tpm_tis_remove() unconditionally calling
flush_work() is triggering a warning for .func still being NULL.

Cc: stable@vger.kernel.org # v6.5+
Fixes: 481c2d14627d ("tpm,tpm_tis: Disable interrupts after 1000 unhandled IRQs")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>

authored by

Jan Beulich and committed by
Jarkko Sakkinen
0ea00e24 32f88d65

+2 -1
+2 -1
drivers/char/tpm/tpm_tis_core.c
··· 1020 1020 interrupt = 0; 1021 1021 1022 1022 tpm_tis_write32(priv, reg, ~TPM_GLOBAL_INT_ENABLE & interrupt); 1023 - flush_work(&priv->free_irq_work); 1023 + if (priv->free_irq_work.func) 1024 + flush_work(&priv->free_irq_work); 1024 1025 1025 1026 tpm_tis_clkrun_enable(chip, false); 1026 1027