Skip to content

extcon: cancel wq_detcable delayed work on driver unbind

Tristan Madani lkml stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5extcon: max14577: cancel wq_detcable on driver unbinddrivers/extcon/extcon-max14577.c+4 -11 reply
2/5extcon: max77693: cancel wq_detcable on driver unbinddrivers/extcon/extcon-max77693.c+4 -10 replies
3/5extcon: max8997: cancel wq_detcable on driver unbinddrivers/extcon/extcon-max8997.c+4 -10 replies
4/5extcon: rt8973a: cancel wq_detcable on driver unbinddrivers/extcon/extcon-rt8973a.c+5 -10 replies
5/5extcon: sm5502: cancel wq_detcable on driver unbinddrivers/extcon/extcon-sm5502.c+5 -10 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by.

PatchYaohan Li
1/5T-b
2/5
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] extcon: cancel wq_detcable delayed work on driver unbind

From: Tristan Madani <[email protected]>

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(-)
Signature · 1 line
2.47.3