* [PATCH] extcon: max14577: Fix potential use-after-free on removal
@ 2026-11-26 8:25 Guangshuo Li
0 siblings, 0 replies; only message in thread
From: Guangshuo Li @ 2026-11-26 8:25 UTC (permalink / raw)
To: cw00.choi, krzk, myungjoo.ham, kyungmin.park; +Cc: linux-kernel
Probe queues delayed cable detection, but removal does not cancel it.
The worker can therefore run after the device resources and private
data have been released.
Use managed delayed work so cable detection is cancelled before its
extcon device and private data are released.
This issue was found by our static analysis tool under development.
Fixes: 962e56bfcf0b ("extcon: max14577: Add extcon-max14577 driver to support MUIC device")
Signed-off-by: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
---
drivers/extcon/extcon-max14577.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/extcon/extcon-max14577.c b/drivers/extcon/extcon-max14577.c
index 7eefc13e9f59..dc13f1997f41 100644
--- a/drivers/extcon/extcon-max14577.c
+++ b/drivers/extcon/extcon-max14577.c
@@ -763,7 +763,10 @@ static int max14577_muic_probe(struct platform_device *pdev)
* After completing the booting of platform, the extcon provider
* driver should notify cable state to upper layer.
*/
- INIT_DELAYED_WORK(&info->wq_detcable, max14577_muic_detect_cable_wq);
+ ret = devm_delayed_work_autocancel(&pdev->dev, &info->wq_detcable,
+ max14577_muic_detect_cable_wq);
+ if (ret)
+ return ret;
queue_delayed_work(system_power_efficient_wq, &info->wq_detcable,
delay_jiffies);
base-commit: 4dce97c6c265544342e716e62fd24bbb232590c5
--
2.43.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-26 8:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-26 8:25 [PATCH] extcon: max14577: Fix potential use-after-free on removal Guangshuo Li
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®