public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/5] ipmi: ssif_bmc: cancel response timer on remove
@ 2026-04-03  9:05 Jian Zhang
  2026-04-03  9:05 ` [PATCH v2 2/5] ipmi: ssif_bmc: fix missing check for copy_to_user() partial failure Jian Zhang
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Jian Zhang @ 2026-04-03  9:05 UTC (permalink / raw)
  To: Corey Minyard, Quan Nguyen, openipmi-developer, linux-kernel

The response timer can stay armed across device teardown. If it fires after
remove, the callback dereferences the SSIF context and the i2c client after
teardown has started.

Cancel the timer in remove so the callback cannot run after the device is
unregistered.

Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>
---
v2: use timer_delete_sync() to cancel the timer

 drivers/char/ipmi/ssif_bmc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/ipmi/ssif_bmc.c b/drivers/char/ipmi/ssif_bmc.c
index 7a52e3ea49ed..dc1d5bb4a460 100644
--- a/drivers/char/ipmi/ssif_bmc.c
+++ b/drivers/char/ipmi/ssif_bmc.c
@@ -843,6 +843,7 @@ static void ssif_bmc_remove(struct i2c_client *client)
 {
 	struct ssif_bmc_ctx *ssif_bmc = i2c_get_clientdata(client);
 
+	timer_delete_sync(&ssif_bmc->response_timer);
 	i2c_slave_unregister(client);
 	misc_deregister(&ssif_bmc->miscdev);
 }
-- 
2.20.1

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

end of thread, other threads:[~2026-04-03 14:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-03  9:05 [PATCH v2 1/5] ipmi: ssif_bmc: cancel response timer on remove Jian Zhang
2026-04-03  9:05 ` [PATCH v2 2/5] ipmi: ssif_bmc: fix missing check for copy_to_user() partial failure Jian Zhang
2026-04-03  9:06 ` [PATCH v2 3/5] ipmi: ssif_bmc: fix message desynchronization after truncated response Jian Zhang
2026-04-03  9:06 ` [PATCH v2 4/5] ipmi: ssif_bmc: change log level to dbg in irq callback Jian Zhang
2026-04-03  9:06 ` [PATCH v2 5/5] ipmi: ssif_bmc: add unit test for state machine Jian Zhang
2026-04-03 13:14   ` Corey Minyard
2026-04-03 14:12     ` Jian Zhang
2026-04-03 14:31       ` Corey Minyard
2026-04-03 13:12 ` [PATCH v2 1/5] ipmi: ssif_bmc: cancel response timer on remove Corey Minyard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox