Re: [PATCH -next] serial: uartlite: Missing uart_unregister_driver() on error in ulite_probe()

From: Johan Hovold
Date: Fri Nov 01 2019 - 07:41:59 EST


On Fri, Nov 01, 2019 at 07:19:50PM +0800, Mao Wenan wrote:
> If uart_register_driver(&ulite_uart_driver) is success,
> but followed function is failed in ulite_probe, it needs to call
> uart_unregister_driver to unregister.
>
> Fixes: f33cf776617b ("serial-uartlite: Move the uart register")
> Signed-off-by: Mao Wenan <maowenan@xxxxxxxxxx>

No, this is broken. The driver is deregistered at module unload.

That said, f33cf776617b ("serial-uartlite: Move the uart register")
should never have been merged as I have pointed out before:

https://lkml.kernel.org/r/20190523091839.GC568@localhost

I'll see if I can find some time to revisit this and start yelling at
Xilinx people again.

Johan