]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: efi_dp_from_lo() don't copy GUID
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 14 Oct 2021 23:31:02 +0000 (01:31 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 21 Oct 2021 01:46:04 +0000 (03:46 +0200)
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 <xypron.glpk@gmx.de>
cmd/efidebug.c
include/efi_loader.h
lib/efi_loader/efi_device_path.c
lib/efi_loader/efi_helper.c

index 67ab06aefc1b38e131e77a882b84d60272323a95..5235dbb7c1b64d51eceab9440a5204feda352c85 100644 (file)
@@ -1169,7 +1169,7 @@ static void show_efi_boot_opt_data(u16 *varname16, void *data, size_t *size)
        printf("  file_path: %ls\n", dp_str);
        efi_free_pool(dp_str);
 
-       initrd_path = efi_dp_from_lo(&lo, &initrd_dp_size, lf2_initrd_guid);
+       initrd_path = efi_dp_from_lo(&lo, &initrd_dp_size, &lf2_initrd_guid);
        if (initrd_path) {
                dp_str = efi_dp_str(initrd_path);
                printf("  initrd_path: %ls\n", dp_str);
index 5cdc72345e52ef52fc1d6b3bb52d6110497ebb87..6e806f9b0db59c2eb6bc45db26fbdc51809554a9 100644 (file)
@@ -842,7 +842,8 @@ struct efi_load_option {
 };
 
 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 *efi_dp_concat(const struct efi_device_path *dp1,
                                      const struct efi_device_path *dp2);
 efi_status_t efi_deserialize_load_option(struct efi_load_option *lo, u8 *data,
index a09090a32e4af6c9f3124311b908aace9c7d7483..a588712ef14c1212e81df379941f35ef854c2de4 100644 (file)
@@ -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);
index d03a7364615e6eb0fda13576a57e2b3bb707dbd1..4c5b7cd2e128e41ae9cab95d5e86d5384f8498da 100644 (file)
@@ -83,7 +83,7 @@ struct efi_device_path *efi_get_dp_from_boot(const efi_guid_t guid)
        if (ret != EFI_SUCCESS)
                goto out;
 
-       tmp = efi_dp_from_lo(&lo, &size, guid);
+       tmp = efi_dp_from_lo(&lo, &size, &guid);
        if (!tmp)
                goto out;