[PATCH] usb: typec: tipd: cancel the poll work on probe error
From: Cong Nguyen
Date: Mon Nov 30 2026 - 07:54:58 EST
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@xxxxxxxxx>
---
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