From: Tristan Madani <tristmd@gmail.com>
To: Chanwoo Choi <cw00.choi@samsung.com>,
MyungJoo Ham <myungjoo.ham@samsung.com>,
Krzysztof Kozlowski <krzk@kernel.org>
Cc: Kyungmin Park <kyungmin.park@samsung.com>,
Seung-Woo Kim <sw0312.kim@samsung.com>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Tristan Madani <tristan@talencesecurity.com>
Subject: [PATCH 0/5] extcon: cancel wq_detcable delayed work on driver unbind
Date: Tue, 20 Oct 2026 15:41:14 +0000 [thread overview]
Message-ID: <20261020154119.2568395-1-tristmd@gmail.com> (raw)
From: Tristan Madani <tristan@talencesecurity.com>
Several extcon MUIC drivers schedule a delayed work (wq_detcable) during
probe for post-boot cable state detection, but never cancel it on driver
unbind. If the device is removed before the work fires, the callback
dereferences freed memory.
Use devm_delayed_work_autocancel() to tie the work lifecycle to the
device. This matches the pattern already used by extcon-gpio,
extcon-palmas, extcon-qcom-spmi-misc, and extcon-intel-int3496.
For the Maxim drivers (max14577, max77693, max8997), irq_work was
already converted to devm_work_autocancel() but wq_detcable was missed.
The rt8973a and sm5502 drivers also need the devm-helpers.h include.
Tristan Madani (5):
extcon: max14577: cancel wq_detcable on driver unbind
extcon: max77693: cancel wq_detcable on driver unbind
extcon: max8997: cancel wq_detcable on driver unbind
extcon: rt8973a: cancel wq_detcable on driver unbind
extcon: sm5502: cancel wq_detcable on driver unbind
drivers/extcon/extcon-max14577.c | 5 ++++-
drivers/extcon/extcon-max77693.c | 5 ++++-
drivers/extcon/extcon-max8997.c | 5 ++++-
drivers/extcon/extcon-rt8973a.c | 6 +++++-
drivers/extcon/extcon-sm5502.c | 6 +++++-
5 files changed, 22 insertions(+), 5 deletions(-)
--
2.47.3
next reply other threads:[~2026-10-20 15:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 15:41 Tristan Madani [this message]
2026-10-20 15:41 ` [PATCH 1/5] extcon: max14577: cancel wq_detcable " Tristan Madani
2026-10-20 15:41 ` [PATCH 2/5] extcon: max77693: " Tristan Madani
2026-10-20 15:41 ` [PATCH 3/5] extcon: max8997: " Tristan Madani
2026-10-20 15:41 ` [PATCH 4/5] extcon: rt8973a: " Tristan Madani
2026-10-20 15:41 ` [PATCH 5/5] extcon: sm5502: " Tristan Madani
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=20261020154119.2568395-1-tristmd@gmail.com \
--to=tristmd@gmail.com \
--cc=cw00.choi@samsung.com \
--cc=krzk@kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=stable@vger.kernel.org \
--cc=sw0312.kim@samsung.com \
--cc=tristan@talencesecurity.com \
/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®