[PATCH v2 03/11] efi_loader: smbiosdump: fix starts_with() returning NULL
Heinrich Schuchardt
heinrich.schuchardt at canonical.com
Sun Jun 21 10:19:07 CEST 2026
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
---
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