Revision 3ef772230db077a7122de11d93cfc4ff570fb4a7 authored by Masami Hiramatsu on 22 June 2021, 14:38:51 UTC, committed by Heinrich Schuchardt on 02 July 2021, 07:37:01 UTC
When running the efidebug capsule disk-update command, the efi_fmp_raw
protocol installation fails with 2 (EFI_INVALID_PARAMETER) as below.
This is because the code passes efi_root instead of the handle local var.

=> efidebug capsule disk-update
EFI: Call: efi_install_multiple_protocol_interfaces( &handle, &efi_guid_firmware_management_protocol, &efi_fmp_fit, NULL)
  EFI: Entry efi_install_multiple_protocol_interfaces(00000000fbaf5988)
    EFI: Call: efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface)
      EFI: Entry efi_install_protocol_interface(00000000fbaf5988, 86c77a67-0b97-4633-a187-49104d0685c7, 0, 00000000fbfa6ee8)
        EFI: new handle 00000000fbb37520
      EFI: Exit: efi_install_protocol_interface: 0
    EFI: 0 returned by efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface)
  EFI: Exit: efi_install_multiple_protocol_interfaces: 0
EFI: 0 returned by efi_install_multiple_protocol_interfaces( &handle, &efi_guid_firmware_management_protocol, &efi_fmp_fit, NULL)
EFI: Call: efi_install_multiple_protocol_interfaces( &efi_root, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL)
  EFI: Entry efi_install_multiple_protocol_interfaces(00000000fbfec648)
    EFI: Call: efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface)
      EFI: Entry efi_install_protocol_interface(00000000fbfec648, 86c77a67-0b97-4633-a187-49104d0685c7, 0, 00000000fbfa6f18)
        EFI: handle 00000000fbaf8520
      EFI: Exit: efi_install_protocol_interface: 2
    EFI: 2 returned by efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface)
  EFI: Exit: efi_install_multiple_protocol_interfaces: 2
EFI: 2 returned by efi_install_multiple_protocol_interfaces( &efi_root, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL)
Command failed, result=1

To fix this issue, pass the handle local var which is set NULL right
before installing efi_fmp_raw as same as the installing efi_fmp_fit.
(In both cases, the local reference to the handle will be just discarded)

Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
1 parent b7ad721
History
File Mode Size
Kconfig -rw-r--r-- 27.1 KB
Makefile -rw-r--r-- 1.2 KB
attr.c -rw-r--r-- 6.7 KB
callback.c -rw-r--r-- 3.3 KB
common.c -rw-r--r-- 8.0 KB
eeprom.c -rw-r--r-- 5.4 KB
embedded.c -rw-r--r-- 2.4 KB
env.c -rw-r--r-- 8.2 KB
ext4.c -rw-r--r-- 3.8 KB
fat.c -rw-r--r-- 4.0 KB
flags.c -rw-r--r-- 14.2 KB
flash.c -rw-r--r-- 9.2 KB
mmc.c -rw-r--r-- 8.1 KB
nand.c -rw-r--r-- 9.0 KB
nowhere.c -rw-r--r-- 1.1 KB
nvram.c -rw-r--r-- 3.1 KB
onenand.c -rw-r--r-- 2.5 KB
remote.c -rw-r--r-- 1.2 KB
sata.c -rw-r--r-- 2.5 KB
sf.c -rw-r--r-- 9.5 KB
ubi.c -rw-r--r-- 4.8 KB

back to top