From: Heinrich Schuchardt Date: Mon, 25 Apr 2022 21:21:20 +0000 (+0200) Subject: efi: fix devpath_is_partition() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=dd1086ac6bda9d464abc9be6a7e24a843b9bf30b;p=u-boot.git efi: fix devpath_is_partition() 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 --- diff --git a/lib/efi/efi_app.c b/lib/efi/efi_app.c index 1e5606c7b8..2209410f35 100644 --- a/lib/efi/efi_app.c +++ b/lib/efi/efi_app.c @@ -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) {