From 0421735dd8ffc82db22c3767e7aa38c65fc7298e Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 15 Oct 2021 01:31:02 +0200 Subject: efi_loader: efi_dp_from_lo() don't copy GUID Instead of copying a GUID and then using a pointer to the copy for calling guidcmp(), just pass the pointer to the orginal GUID. Signed-off-by: Heinrich Schuchardt --- lib/efi_loader/efi_device_path.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/efi_loader/efi_device_path.c') diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index a09090a32e4..a588712ef14 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -1218,7 +1218,8 @@ ssize_t efi_dp_check_length(const struct efi_device_path *dp, */ struct efi_device_path *efi_dp_from_lo(struct efi_load_option *lo, - efi_uintn_t *size, efi_guid_t guid) + efi_uintn_t *size, + const efi_guid_t *guid) { struct efi_device_path *fp = lo->file_path; struct efi_device_path_vendor *vendor; @@ -1233,7 +1234,7 @@ efi_device_path *efi_dp_from_lo(struct efi_load_option *lo, continue; vendor = (struct efi_device_path_vendor *)fp; - if (!guidcmp(&vendor->guid, &guid)) + if (!guidcmp(&vendor->guid, guid)) return efi_dp_dup(fp); } log_debug("VenMedia(%pUl) not found in %ls\n", &guid, lo->label); -- cgit v1.2.3