• M
    efi: Pass correct file handle to efi_file_{read,close} · 47514c99
    Matt Fleming 提交于
    We're currently passing the file handle for the root file system to
    efi_file_read() and efi_file_close(), instead of the file handle for the
    file we wish to read/close.
    
    While this has worked up until now, it seems that it has only been by
    pure luck. Olivier explains,
    
     "The issue is the UEFI Fat driver might return the same function for
      'fh->read()' and 'h->read()'. While in our case it does not work with
      a different implementation of EFI_SIMPLE_FILE_SYSTEM_PROTOCOL. In our
      case, we return a different pointer when reading a directory and
      reading a file."
    
    Fixing this actually clears up the two functions because we can drop one
    of the arguments, and instead only pass a file 'handle' argument.
    Reported-by: NOlivier Martin <olivier.martin@arm.com>
    Reviewed-by: NOlivier Martin <olivier.martin@arm.com>
    Reviewed-by: NMark Rutland <mark.rutland@arm.com>
    Cc: Leif Lindholm <leif.lindholm@linaro.org>
    Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
    47514c99
efi-stub-helper.c 12.9 KB