Re: [PATCH] auxdisplay: charlcd: cancel backlight work on registration failure
From: Andy Shevchenko
Date: Wed Aug 12 2026 - 05:40:45 EST
On Wed, Aug 12, 2026 at 10:50:11AM +0200, Geert Uytterhoeven wrote:
> 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>
Thanks!
> > 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()?
I am fine with either choice.
--
With Best Regards,
Andy Shevchenko