All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] efi: fix devpath_is_partition()
@ 2022-04-25 21:23 Heinrich Schuchardt
  0 siblings, 0 replies; only message in thread
From: Heinrich Schuchardt @ 2022-04-25 21:23 UTC (permalink / raw)
  To: Simon Glass; +Cc: u-boot, Heinrich Schuchardt

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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) {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-25 21:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25 21:23 [PATCH 1/1] efi: fix devpath_is_partition() Heinrich Schuchardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.