]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
efi_loader: fix EFI_FILE_PROTOCOL.GetInfo()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 9 Feb 2019 21:23:48 +0000 (22:23 +0100)
committerAlexander Graf <agraf@suse.de>
Wed, 13 Feb 2019 08:40:06 +0000 (09:40 +0100)
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>
lib/efi_loader/efi_file.c

index 9d709a8db026457480c8b79118423b45466004c7..4b4422205dd9ce0c5022e4a8bd77ec671b1e56fb 100644 (file)
@@ -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 {