efi_loader: Fix to set bootdev_root correctly if bootdev found
PATCH 1/1 efi_loader: Fix to set bootdev_root correctly if bootdev found
Fix find_boot_device() to set bootdev_root if it finds the bootdev from BootNext. Currently it sets the bootdev_root only when it finds bootdev from BootOrder.
--- lib/efi_loader/efi_capsule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
lib/efi_loader/efi_capsule.c +2 -1
@@ -632,7 +632,7 @@ static efi_status_t find_boot_device(void) ret =get_dp_device (boot_var16, &boot_dev);if (ret ==EFI_SUCCESS ) {if (device_is_present_and_system_part (boot_dev)) { - goto out; + goto found; }else {efi_free_pool (boot_dev); boot_dev =NULL ;
@@ -675,6 +675,7 @@ skip:efi_free_pool (boot_dev); boot_dev =NULL ; } +found:if (boot_dev) {u16 *path_str;
Quoted 24 lines · Masami Hiramatsu
Fix
find_boot_device()to setbootdev_rootif it finds the bootdev from BootNext. Currently it sets thebootdev_rootonly when it finds bootdev from BootOrder.Fixes c74cd8bd08d1 ("efi_loader: capsule: add capsule_on_disk support")Signed-off-by Masami Hiramatsu <[email protected]>--- lib/efi_loader/efi_capsule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)lib/efi_loader/efi_capsule.c +1
-1@@ -632,7 +632,7 @@ static efi_status_t find_boot_device(void) ret =get_dp_device (boot_var16, &boot_dev);if (ret ==EFI_SUCCESS ) {if (device_is_present_and_system_part (boot_dev)) { - goto out; + goto found; }else {efi_free_pool (boot_dev); boot_dev =NULL ;
lib/efi_loader/efi_capsule.c skip: · line 680
Quoted 6 lines
lib/efi_loader/efi_capsule.c +1
-0@@ -675,6 +675,7 @@ skip:efi_free_pool (boot_dev); boot_dev =NULL ; } +found:if (boot_dev) {u16 *path_str;
The code that follows should be reworked too:
<cite>
u16 *path_str;
path_str = efi_dp_str(boot_dev);log_debug("Boot device %ls\n", path_str);efi_free_pool(path_str);
</cite>
Use log-debug("Boot device %pD\n", boot_dev); instead.
But that is work for a separate patch.
Quoted 2 lines
Ilias Apalodimas
Acked-byQuoted 52 lines · Heinrich Schuchardt
Quoted 24 lines · Masami Hiramatsu
Fix
find_boot_device()to setbootdev_rootif it finds the bootdev from BootNext. Currently it sets thebootdev_rootonly when it finds bootdev from BootOrder.Fixes c74cd8bd08d1 ("efi_loader: capsule: add capsule_on_disk support")Signed-off-by Masami Hiramatsu <[email protected]>--- lib/efi_loader/efi_capsule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)lib/efi_loader/efi_capsule.c +1
-1@@ -632,7 +632,7 @@ static efi_status_t find_boot_device(void) ret =get_dp_device (boot_var16, &boot_dev);if (ret ==EFI_SUCCESS ) {if (device_is_present_and_system_part (boot_dev)) { - goto out; + goto found; }else {efi_free_pool (boot_dev); boot_dev =NULL ;lib/efi_loader/efi_capsule.c skip: · line 680
Quoted 6 lines
lib/efi_loader/efi_capsule.c +1
-0@@ -675,6 +675,7 @@ skip:efi_free_pool (boot_dev); boot_dev =NULL ; } +found:if (boot_dev) {u16 *path_str;The code that follows should be reworked too:
<cite>
u16*path_str;
path_str=efi_dp_str(boot_dev);log_debug("Boot device %ls\n", path_str);efi_free_pool(path_str);
</cite>Use log-debug("Boot device %pD\n",
boot_dev); instead.But that is work for a separate patch.
Reviewed-by Heinrich Schuchardt <[email protected]>Quoted 2 lines
Hi Heinrich,
2021年7月13日(火) 2:40 Heinrich Schuchardt <[email protected]>:
Quoted 38 lines · Masami Hiramatsu
Quoted 24 lines
Fix
find_boot_device()to setbootdev_rootif it finds the bootdev from BootNext. Currently it sets thebootdev_rootonly when it finds bootdev from BootOrder.Fixes c74cd8bd08d1 ("efi_loader: capsule: add capsule_on_disk support")Signed-off-by Masami Hiramatsu <[email protected]>--- lib/efi_loader/efi_capsule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)lib/efi_loader/efi_capsule.c +1
-1@@ -632,7 +632,7 @@ static efi_status_t find_boot_device(void) ret =get_dp_device (boot_var16, &boot_dev);if (ret ==EFI_SUCCESS ) {if (device_is_present_and_system_part (boot_dev)) { - goto out; + goto found; }else {efi_free_pool (boot_dev); boot_dev =NULL ;lib/efi_loader/efi_capsule.c skip: · line 680
Quoted 6 lines
lib/efi_loader/efi_capsule.c +1
-0@@ -675,6 +675,7 @@ skip:efi_free_pool (boot_dev); boot_dev =NULL ; } +found:if (boot_dev) {u16 *path_str;The code that follows should be reworked too:
<cite>
u16*path_str;
Quoted 8 lines
path_str=efi_dp_str(boot_dev);log_debug("Boot device %ls\n", path_str);efi_free_pool(path_str);
</cite>Use log-debug("Boot device %pD\n",
boot_dev); instead.But that is work for a separate patch.
OK, let me fix that.
Quoted 2 lines
Reviewed-by Heinrich Schuchardt <[email protected]>
Thank you!
Quoted 4 lines
Quoted 3 lines
Signature · 1 line
Masami Hiramatsu