[PATCH v2 03/11] efi_loader: smbiosdump: fix starts_with() returning NULL
Ilias Apalodimas
ilias.apalodimas at linaro.org
Mon Jun 22 10:07:32 CEST 2026
On Sun, 21 Jun 2026 at 11:19, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
> starts_with() is declared as returning bool, but the null-argument
> guard returned NULL (a pointer cast to bool) instead of false.
> While harmless on most platforms where NULL and false both have
> value zero, it is technically incorrect.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
> v2:
> new patch
> ---
Reviewed-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
>
> lib/efi_loader/smbiosdump.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/efi_loader/smbiosdump.c b/lib/efi_loader/smbiosdump.c
> index d7f2ba30a95..974728a43af 100644
> --- a/lib/efi_loader/smbiosdump.c
> +++ b/lib/efi_loader/smbiosdump.c
> @@ -199,7 +199,7 @@ static u16 *skip_whitespace(u16 *pos)
> static bool starts_with(u16 *string, u16 *keyword)
> {
> if (!string || !keyword)
> - return NULL;
> + return false;
>
> for (; *keyword; ++string, ++keyword) {
> if (*string != *keyword)
> --
> 2.53.0
>
More information about the U-Boot
mailing list