[PATCH master] common: console_common: handle NULL dev gracefully in dev_printf

Sascha Hauer s.hauer at pengutronix.de
Wed Mar 13 03:50:06 PDT 2024


On Wed, 13 Mar 2024 10:26:33 +0100, Ahmad Fatoum wrote:
> dev_name(NULL) returns NULL, which snprintf can handle, but dev->driver
> used beforehand would derference the NULL pointer without checking.
> 
> Fix this by checking that dev is !NULL before dereferencing.
> This still leads to an ugly <NULL>: prefix, when a NULL dev is used, so
> it can be fixed, but without the crash, which might be difficult to
> pinpoint if the print happens early.
> 
> [...]

Applied, thanks!

[1/1] common: console_common: handle NULL dev gracefully in dev_printf
      https://git.pengutronix.de/cgit/barebox/commit/?id=d20abb491654 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer at pengutronix.de>




More information about the barebox mailing list