[PATCH] serial: ns16550: fix memory leak of linux_earlycon_name on probe failure
Sascha Hauer
s.hauer at pengutronix.de
Wed Sep 2 01:29:35 PDT 2026
On Mon, 31 Aug 2026 15:04:17 +0300, Alexander Shiyan wrote:
> When console_register() fails, the dynamically allocated
> linux_earlycon_name string was not freed, leading to a memory leak.
> Add a free_const() call on the error path to release it.
>
> Also simplify the success path by returning 0 directly after
> successful registration, making the code more readable.
>
> [...]
Applied, thanks!
[1/1] serial: ns16550: fix memory leak of linux_earlycon_name on probe failure
https://git.pengutronix.de/cgit/barebox/commit/?id=5e97fb61df43 (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer at pengutronix.de>
More information about the barebox
mailing list