Re: [PATCH v2] leds: tca6507: Fix use-after-free on unbind

From: Lee Jones

Date: Wed Oct 28 2026 - 11:20:23 EST


On Wed, 28 Oct 2026, Danish Khateeb wrote:

> On Wed, 28 Oct 2026, Lee Jones wrote:
> > Please review, explain or fix the Sashiko review(s).
>
> Sashiko is right that the "LED off" write queued on unbind gets
> cancelled, but that predates 1b5c2fa7081c: remove() used to call
> led_classdev_unregister() and then cancel_work_sync(), the same order
> this patch restores. Since 1b5c2fa7081c that write only ran on freed
> memory. If you'd like the LEDs turned off on unbind, I can send a
> separate patch that flushes the work instead of cancelling it.

Submit them as a set.

--
Lee Jones