[PATCH] serial: meson: unregister the UART driver if port registration fails

Greg Kroah-Hartman gregkh at linuxfoundation.org
Wed Nov 4 02:49:58 PST 2026


On Wed, Nov 04, 2026 at 08:02:33AM +0100, Jiri Slaby wrote:
> On 04. 11. 26, 3:15, Wentao Liang wrote:
> > meson_uart_probe() registers the shared uart_driver on the first port and
> > relies on meson_uart_remove() to unregister it once the last port is
> > removed.  If uart_add_one_port() fails, probe returns an error, so remove
> > is never called and the driver stays registered, leaking its tty driver
> > and per-port state.
> > 
> > Remember whether this probe registered the driver and unregister it again
> > when adding the port fails.
> > 
> > Fixes: e71aab9d6132 ("tty: serial: meson: apply ttyS devname instead of ttyAML for new SoCs")
> > Cc: stable at vger.kernel.org
> > Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> > Signed-off-by: Wentao Liang <vulab at iscas.ac.cn>
> 
> makes sense to me:
> Reviewed-by: Jiri Slaby <jirislaby at kernel.org>

Nope, this is a bot, I strongly recommend that everyone just add this
address to their email killfile as they never respond and spam out tons
of crap.

thanks,

greg k-h



More information about the linux-amlogic mailing list