mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usb: typec: tipd: cancel the poll work on probe error
@ 2026-11-30 12:54 Cong Nguyen
  0 siblings, 0 replies; only message in thread
From: Cong Nguyen @ 2026-11-30 12:54 UTC (permalink / raw)
  To: Heikki Krogerus, Greg Kroah-Hartman
  Cc: Roger Quadros, linux-usb, linux-kernel

In polling mode tps6598x_probe() queues wq_poll and then tests ret. If
the connect() callback failed earlier, ret still holds that error, so
probe jumps to err_disconnect with the poll work queued. Nothing cancels
it before the devm-allocated tps is freed.

Cancel the poll work at err_disconnect, as tps6598x_remove() does.

Fixes: 0d6a119cecd7 ("usb: typec: tps6598x: Add support for polling interrupts status")
Signed-off-by: Cong Nguyen <congnt264@gmail.com>
---
 drivers/usb/typec/tipd/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
index 02539378ffed..991d42e35777 100644
--- a/drivers/usb/typec/tipd/core.c
+++ b/drivers/usb/typec/tipd/core.c
@@ -1928,6 +1928,8 @@ static int tps6598x_probe(struct i2c_client *client)
 	return 0;
 
 err_disconnect:
+	if (!client->irq)
+		cancel_delayed_work_sync(&tps->wq_poll);
 	tps6598x_disconnect(tps, 0);
 err_unregister_port:
 	tps->data->unregister_port(tps);
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-30 12:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-30 12:54 [PATCH] usb: typec: tipd: cancel the poll work on probe error Cong Nguyen

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

all inboxes | Powered by JetHome®