aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt2022-04-25 23:21:20 +0200
committerHeinrich Schuchardt2022-04-29 14:25:39 +0200
commitdd1086ac6bda9d464abc9be6a7e24a843b9bf30b (patch)
treec8abe8f94aae51a680aab5a4d58f652c47fbcf04 /lib
parent7ea79e511d308fb8aea4189d1617ee59887d3807 (diff)
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 <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi/efi_app.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/efi/efi_app.c b/lib/efi/efi_app.c
index 1e5606c7b82..2209410f35b 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) {