]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi: fix devpath_is_partition()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 25 Apr 2022 21:21:20 +0000 (23:21 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 29 Apr 2022 12:25:39 +0000 (14:25 +0200)
If the path consists only of an end node, it does not refer to a partition.
Avoid returning a random value from the stack in this case.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/efi/efi_app.c

index 1e5606c7b824b59bf9e0c2fb5890d4d58c9d010a..2209410f35b54d1c2a2df6231dc4361efc3825e3 100644 (file)
@@ -190,7 +190,7 @@ static void free_memory(struct efi_priv *priv)
 static bool devpath_is_partition(const struct efi_device_path *path)
 {
        const struct efi_device_path *p;
-       bool was_part;
+       bool was_part = false;
 
        for (p = path; p->type != DEVICE_PATH_TYPE_END;
             p = (void *)p + p->length) {