]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
cmd: mbr: return false instead of NULL from bool found_key()
authorNaveen Kumar Chaudhary <naveen.osdev@gmail.com>
Fri, 10 Jul 2026 15:22:15 +0000 (20:52 +0530)
committerTom Rini <trini@konsulko.com>
Thu, 23 Jul 2026 21:16:09 +0000 (15:16 -0600)
found_key() is declared to return bool but returns NULL when strdup()
fails. NULL is a pointer constant; while it happens to convert to
zero (i.e. false) it is a type mismatch that trips stricter
compilers/static analysers.

Return false to match the declared return type.

Signed-off-by: Naveen Kumar Chaudhary <naveen.osdev@gmail.com>
cmd/mbr.c

index 7fe6c9e103ab7b80592487b775a240a6c7bf1c27..b282b68d50ee645e891173115d6a6d16cccbce40 100644 (file)
--- a/cmd/mbr.c
+++ b/cmd/mbr.c
@@ -73,7 +73,7 @@ static bool found_key(const char *str, const char *key)
 
        strcopy = strdup(str);
        if (!strcopy)
-               return NULL;
+               return false;
 
        s = strcopy;
        while (s) {