diff options
author | Vincent Stehlé <vincent.stehle@arm.com> | 2024-07-03 13:37:56 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-07-16 17:09:33 -0600 |
commit | 1b1b1e7f6038047d425a75756333cadd037b3f64 (patch) | |
tree | d303c265971f3a9d7df301c954cfb83a4232a55e /boot/bootmeth_cros.c | |
parent | 0a1bf35f5f0750ae281aaaa6305c4fedbeb6e47e (diff) |
bootstd: cros: store partition type in an efi_guid_t
The scan_part() function uses a struct uuid to store the little-endian
partition type GUID, but this structure should be used only to contain a
big-endian UUID. Use an efi_guid_t instead and use guidcmp() for the
comparison.
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'boot/bootmeth_cros.c')
-rw-r--r-- | boot/bootmeth_cros.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/boot/bootmeth_cros.c b/boot/bootmeth_cros.c index 645b8bed102..676f550ca25 100644 --- a/boot/bootmeth_cros.c +++ b/boot/bootmeth_cros.c @@ -147,7 +147,7 @@ static int scan_part(struct udevice *blk, int partnum, { struct blk_desc *desc = dev_get_uclass_plat(blk); struct vb2_keyblock *hdr; - struct uuid type; + efi_guid_t type; ulong num_blks; int ret; @@ -160,10 +160,10 @@ static int scan_part(struct udevice *blk, int partnum, /* Check for kernel partition type */ log_debug("part %x: type=%s\n", partnum, info->type_guid); - if (uuid_str_to_bin(info->type_guid, (u8 *)&type, UUID_STR_FORMAT_GUID)) + if (uuid_str_to_bin(info->type_guid, type.b, UUID_STR_FORMAT_GUID)) return log_msg_ret("typ", -EINVAL); - if (memcmp(&cros_kern_type, &type, sizeof(type))) + if (guidcmp(&cros_kern_type, &type)) return log_msg_ret("typ", -ENOEXEC); /* Make a buffer for the header information */ |