Re: [PATCH] auxdisplay: charlcd: cancel backlight work on registration failure

From: Geert Uytterhoeven

Date: Wed Aug 12 2026 - 04:51:13 EST


On Wed, 12 Aug 2026 at 10:37, Andy Shevchenko
<andriy.shevchenko@xxxxxxxxx> wrote:
> On Sun, Jul 19, 2026 at 05:53:31PM +0200, Miguel Ojeda wrote:
> > On Sun, Jul 19, 2026 at 4:43 PM Hongyan Xu <getshell@xxxxxxxxxx> wrote:
> > >
> > > With CONFIG_CHARLCD_BL_FLASH, charlcd_init() schedules bl_work before
> > > charlcd_register() calls misc_register(). If registration fails, the
> > > caller frees the charlcd object while delayed work still contains its
> > > address.
> > >
> > > Cancel the delayed work and turn the backlight off before returning the
> > > registration error.
> > >
> > > Signed-off-by: Hongyan Xu <getshell@xxxxxxxxxx>
> >
> > I think you may have used an out-of-date `MAINTAINERS` file...
> >
> > Cc'ing auxdisplay as well as Lars and Willy who were involved in the
> > past with `charlcd`.
>
> Geert, are you okay with the change?
> I have browsed the code and the report seems valid.

Reviewed-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>

> Hongyan, the patch adds the same piece that's already present in the
> charlcd_unregister(). Can you split that to the helper function like
> charlcd_bl_cancel_work()?

Or charlcd_deinit(), as it basically undoes charlcd_init()?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds