summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2024-05-29 14:23:25 +0200
committerJarkko Sakkinen <jarkko@kernel.org>2024-06-05 00:18:01 +0200
commit0ea00e249ca992adee54dc71a526ee70ef109e40 (patch)
tree1ec5a75bcbfd63dde8313d2c8aa818afd038403e /drivers/char
parentMerge tag 'linux_kselftest-fixes-6.10-rc3' of git://git.kernel.org/pub/scm/li... (diff)
downloadlinux-0ea00e249ca992adee54dc71a526ee70ef109e40.tar.xz
linux-0ea00e249ca992adee54dc71a526ee70ef109e40.zip
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>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/tpm/tpm_tis_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index 176cd8dbf1db..fdef214b9f6b 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -1020,7 +1020,8 @@ void tpm_tis_remove(struct tpm_chip *chip)
interrupt = 0;
tpm_tis_write32(priv, reg, ~TPM_GLOBAL_INT_ENABLE & interrupt);
- flush_work(&priv->free_irq_work);
+ if (priv->free_irq_work.func)
+ flush_work(&priv->free_irq_work);
tpm_tis_clkrun_enable(chip, false);