summaryrefslogtreecommitdiffstats
path: root/lib/efi_loader/efi_file.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2019-02-09 22:23:48 +0100
committerAlexander Graf <agraf@suse.de>2019-02-13 09:40:06 +0100
commit823c233b7ab95169ea4428b2821b72b8887b47b0 (patch)
tree6214d5fe9a24d21b9a729a1bda3fdd22e442d298 /lib/efi_loader/efi_file.c
parent0e66c10a7d808062898f9a19f0c95f04d8dd85ed (diff)
downloadu-boot-823c233b7ab95169ea4428b2821b72b8887b47b0.tar.gz
u-boot-823c233b7ab95169ea4428b2821b72b8887b47b0.tar.xz
u-boot-823c233b7ab95169ea4428b2821b72b8887b47b0.zip
efi_loader: fix EFI_FILE_PROTOCOL.GetInfo()
We check the existence of files with fs_exist(). This function calls fs_close(). If we do not set the active block device again fs_opendir() fails and we do not set the flag EFI_FILE_DIRECTORY. Due to this error the `cd` command in the EFI shell fails. So let's add the missing set_blk_dev(fh) call. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib/efi_loader/efi_file.c')
-rw-r--r--lib/efi_loader/efi_file.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c
index 9d709a8db0..4b4422205d 100644
--- a/lib/efi_loader/efi_file.c
+++ b/lib/efi_loader/efi_file.c
@@ -200,6 +200,10 @@ static struct efi_file_handle *file_open(struct file_system *fs,
fs_exists(fh->path)))
goto error;
+ /* fs_exists() calls fs_close(), so open file system again */
+ if (set_blk_dev(fh))
+ goto error;
+
/* figure out if file is a directory: */
fh->isdir = is_dir(fh);
} else {