efi: Pass correct file handle to efi_file_{read,close}
authorMatt Fleming <matt.fleming@intel.com>
Thu, 10 Apr 2014 13:11:45 +0000 (14:11 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 16 Jun 2014 20:33:40 +0000 (21:33 +0100)
commit28a86520a1de542b17fcba08e23f7c661e759ecd
tree89051c16c253b5809d4c3c5eeea4d9a2431710c9
parenteac39524c3e8648d35ea132feeab3b94d119231d
efi: Pass correct file handle to efi_file_{read,close}

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: Olivier Martin <olivier.martin@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
(cherry picked from commit 47514c996fac5e6f13ef3a4c5e23f1c5cffabb7b)
Signed-off-by: Mark Brown <broonie@linaro.org>
Conflicts:
arch/x86/boot/compressed/eboot.c
drivers/firmware/efi/efi-stub-helper.c