diff options
author | Tom Rini | 2019-03-05 08:51:48 -0500 |
---|---|---|
committer | Tom Rini | 2019-03-05 08:51:48 -0500 |
commit | ca1e50063af7d21f37ed5d1209908a77698b1b68 (patch) | |
tree | d1626fb9e89bc7947bc99905a9047ea5a125dc01 | |
parent | f08023c07d826fbc8e62fdd3367961b2f0b06844 (diff) | |
parent | 1a9fce50393d2e7b7c3adb70764ab22a9267d815 (diff) |
Merge tag 'efi-2019-04-rc4' of https://github.com/xypron2/u-boot
Pull request for the UEFI subsystem for v2019.04-rc4
This pull request contains only bug fixes.
The most notable bug fixed was writing to random memory addresses when
trying to add a HII package of a yet unsupported package type.
-rw-r--r-- | cmd/efidebug.c | 2 | ||||
-rw-r--r-- | lib/efi_loader/efi_device_path.c | 7 | ||||
-rw-r--r-- | lib/efi_loader/efi_hii.c | 38 |
3 files changed, 21 insertions, 26 deletions
diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 5072a7b39bc..db96682c5a4 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -491,7 +491,7 @@ static int do_efi_boot_add(cmd_tbl_t *cmdtp, int flag, id = (int)simple_strtoul(argv[1], &endp, 16); if (*endp != '\0' || id > 0xffff) - return CMD_RET_FAILURE; + return CMD_RET_USAGE; sprintf(var_name, "Boot%04X", id); p = var_name16; diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index 98c36e798f5..53b40c8c3c2 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -985,12 +985,7 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr, if (!path) return EFI_SUCCESS; - if (!is_net) { - /* Add leading / to fs paths, because they're absolute */ - snprintf(filename, sizeof(filename), "/%s", path); - } else { - snprintf(filename, sizeof(filename), "%s", path); - } + snprintf(filename, sizeof(filename), "%s", path); /* DOS style file path: */ s = filename; while ((s = strchr(s, '/'))) diff --git a/lib/efi_loader/efi_hii.c b/lib/efi_loader/efi_hii.c index d63d2d84184..3a966fa4dff 100644 --- a/lib/efi_loader/efi_hii.c +++ b/lib/efi_loader/efi_hii.c @@ -343,6 +343,7 @@ static struct efi_hii_packagelist *new_packagelist(void) struct efi_hii_packagelist *hii; hii = malloc(sizeof(*hii)); + list_add_tail(&hii->link, &efi_package_lists); hii->max_string_id = 0; INIT_LIST_HEAD(&hii->string_tables); INIT_LIST_HEAD(&hii->guid_list); @@ -387,7 +388,7 @@ add_packages(struct efi_hii_packagelist *hii, (struct efi_hii_guid_package *)package); break; case EFI_HII_PACKAGE_FORMS: - printf("\tForm package not supported\n"); + EFI_PRINT("Form package not supported\n"); ret = EFI_INVALID_PARAMETER; break; case EFI_HII_PACKAGE_STRINGS: @@ -395,19 +396,19 @@ add_packages(struct efi_hii_packagelist *hii, (struct efi_hii_strings_package *)package); break; case EFI_HII_PACKAGE_FONTS: - printf("\tFont package not supported\n"); + EFI_PRINT("Font package not supported\n"); ret = EFI_INVALID_PARAMETER; break; case EFI_HII_PACKAGE_IMAGES: - printf("\tImage package not supported\n"); + EFI_PRINT("Image package not supported\n"); ret = EFI_INVALID_PARAMETER; break; case EFI_HII_PACKAGE_SIMPLE_FONTS: - printf("\tSimple font package not supported\n"); + EFI_PRINT("Simple font package not supported\n"); ret = EFI_INVALID_PARAMETER; break; case EFI_HII_PACKAGE_DEVICE_PATH: - printf("\tDevice path package not supported\n"); + EFI_PRINT("Device path package not supported\n"); ret = EFI_INVALID_PARAMETER; break; case EFI_HII_PACKAGE_KEYBOARD_LAYOUT: @@ -415,7 +416,7 @@ add_packages(struct efi_hii_packagelist *hii, (struct efi_hii_keyboard_package *)package); break; case EFI_HII_PACKAGE_ANIMATIONS: - printf("\tAnimation package not supported\n"); + EFI_PRINT("Animation package not supported\n"); ret = EFI_INVALID_PARAMETER; break; case EFI_HII_PACKAGE_END: @@ -465,7 +466,6 @@ new_package_list(const struct efi_hii_database_protocol *this, } hii->driver_handle = driver_handle; - list_add_tail(&hii->link, &efi_package_lists); *handle = hii; return EFI_EXIT(EFI_SUCCESS); @@ -522,33 +522,33 @@ update_package_list(const struct efi_hii_database_protocol *this, remove_guid_package(hii); break; case EFI_HII_PACKAGE_FORMS: - printf("\tForm package not supported\n"); + EFI_PRINT("Form package not supported\n"); ret = EFI_INVALID_PARAMETER; break; case EFI_HII_PACKAGE_STRINGS: remove_strings_package(hii); break; case EFI_HII_PACKAGE_FONTS: - printf("\tFont package not supported\n"); + EFI_PRINT("Font package not supported\n"); ret = EFI_INVALID_PARAMETER; break; case EFI_HII_PACKAGE_IMAGES: - printf("\tImage package not supported\n"); + EFI_PRINT("Image package not supported\n"); ret = EFI_INVALID_PARAMETER; break; case EFI_HII_PACKAGE_SIMPLE_FONTS: - printf("\tSimple font package not supported\n"); + EFI_PRINT("Simple font package not supported\n"); ret = EFI_INVALID_PARAMETER; break; case EFI_HII_PACKAGE_DEVICE_PATH: - printf("\tDevice path package not supported\n"); + EFI_PRINT("Device path package not supported\n"); ret = EFI_INVALID_PARAMETER; break; case EFI_HII_PACKAGE_KEYBOARD_LAYOUT: remove_keyboard_package(hii); break; case EFI_HII_PACKAGE_ANIMATIONS: - printf("\tAnimation package not supported\n"); + EFI_PRINT("Animation package not supported\n"); ret = EFI_INVALID_PARAMETER; break; case EFI_HII_PACKAGE_END: @@ -609,7 +609,7 @@ list_package_lists(const struct efi_hii_database_protocol *this, break; continue; case EFI_HII_PACKAGE_FORMS: - printf("\tForm package not supported\n"); + EFI_PRINT("Form package not supported\n"); ret = EFI_INVALID_PARAMETER; continue; case EFI_HII_PACKAGE_STRINGS: @@ -617,19 +617,19 @@ list_package_lists(const struct efi_hii_database_protocol *this, break; continue; case EFI_HII_PACKAGE_FONTS: - printf("\tFont package not supported\n"); + EFI_PRINT("Font package not supported\n"); ret = EFI_INVALID_PARAMETER; continue; case EFI_HII_PACKAGE_IMAGES: - printf("\tImage package not supported\n"); + EFI_PRINT("Image package not supported\n"); ret = EFI_INVALID_PARAMETER; continue; case EFI_HII_PACKAGE_SIMPLE_FONTS: - printf("\tSimple font package not supported\n"); + EFI_PRINT("Simple font package not supported\n"); ret = EFI_INVALID_PARAMETER; continue; case EFI_HII_PACKAGE_DEVICE_PATH: - printf("\tDevice path package not supported\n"); + EFI_PRINT("Device path package not supported\n"); ret = EFI_INVALID_PARAMETER; continue; case EFI_HII_PACKAGE_KEYBOARD_LAYOUT: @@ -637,7 +637,7 @@ list_package_lists(const struct efi_hii_database_protocol *this, break; continue; case EFI_HII_PACKAGE_ANIMATIONS: - printf("\tAnimation package not supported\n"); + EFI_PRINT("Animation package not supported\n"); ret = EFI_INVALID_PARAMETER; continue; case EFI_HII_PACKAGE_END: |