From: Cong Nguyen <congnt264@gmail.com>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Roger Quadros <rogerq@kernel.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] usb: typec: tipd: cancel the poll work on probe error
Date: Mon, 30 Nov 2026 19:54:48 +0700 [thread overview]
Message-ID: <20261130125448.2300198-1-congnt264@gmail.com> (raw)
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
reply other threads:[~2026-11-30 12:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261130125448.2300198-1-congnt264@gmail.com \
--to=congnt264@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=rogerq@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®