All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tpm_tis: don't flush never initialized work
@ 2023-09-14 14:28 Jan Beulich
  2023-09-14 15:19 ` Jarkko Sakkinen
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Beulich @ 2023-09-14 14:28 UTC (permalink / raw)
  To: linux-integrity; +Cc: Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe

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.

Fixes: 481c2d14627d ("tpm,tpm_tis: Disable interrupts after 1000 unhandled IRQs")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
An alternative would be to move INIT_WORK(), but where to put it is far
more difficult to tell for an outsider than simply making the flush call
conditional.

--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -1022,7 +1022,8 @@ void tpm_tis_remove(struct tpm_chip *chi
 		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);
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-05-29 12:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-14 14:28 [PATCH] tpm_tis: don't flush never initialized work Jan Beulich
2023-09-14 15:19 ` Jarkko Sakkinen
2023-09-14 15:29   ` Jan Beulich
2023-09-14 15:42     ` Jarkko Sakkinen
2024-05-29  7:47     ` Ping: " Jan Beulich
2024-05-29 12:26       ` Jarkko Sakkinen
2024-05-29 12:32         ` Jan Beulich
2024-05-29 12:37           ` Jarkko Sakkinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.