]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: efidebug: simplify do_efi_boot_add()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 23 Mar 2022 19:26:25 +0000 (20:26 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 26 Mar 2022 06:46:21 +0000 (07:46 +0100)
When calling efi_dp_from_name() we are not interested in the device part.
Just pass NULL as an argument.

Suggested-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
cmd/efidebug.c

index 51e2850d218b7afa4415016cc777b9b92baee5ec..3cc6f2bfcca803ae710a8dc35e6bf36b2c701c84 100644 (file)
@@ -810,7 +810,7 @@ static int do_efi_boot_add(struct cmd_tbl *cmdtp, int flag,
        efi_guid_t guid;
        size_t label_len, label_len16;
        u16 *label;
-       struct efi_device_path *device_path = NULL, *file_path = NULL;
+       struct efi_device_path *file_path = NULL;
        struct efi_device_path *fp_free = NULL;
        struct efi_device_path *final_fp = NULL;
        struct efi_device_path *initrd_dp = NULL;
@@ -865,7 +865,7 @@ static int do_efi_boot_add(struct cmd_tbl *cmdtp, int flag,
 
                        /* file path */
                        ret = efi_dp_from_name(argv[3], argv[4], argv[5],
-                                              &device_path, &fp_free);
+                                              NULL, &fp_free);
                        if (ret != EFI_SUCCESS) {
                                printf("Cannot create device path for \"%s %s\"\n",
                                       argv[3], argv[4]);
@@ -953,7 +953,6 @@ out:
        free(data);
        efi_free_pool(final_fp);
        efi_free_pool(initrd_dp);
-       efi_free_pool(device_path);
        efi_free_pool(fp_free);
        free(lo.label);