From patchwork Fri Feb 28 00:05:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 236966 List-Id: U-Boot discussion From: takahiro.akashi at linaro.org (AKASHI Takahiro) Date: Fri, 28 Feb 2020 09:05:49 +0900 Subject: [PATCH] efi_loader: file: set a backend block device for file operations Message-ID: <20200228000549.1937-1-takahiro.akashi@linaro.org> In the current implementation, set_blk_dev() is called in opening a file, but not in opening a directory. This will cause failures at succeeding directory operations as the "current" block device remains nullified. Adding set_blk_dev() fixes this issue. Signed-off-by: AKASHI Takahiro --- lib/efi_loader/efi_file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c index 140116ddc4ac..ba55b2829e03 100644 --- a/lib/efi_loader/efi_file.c +++ b/lib/efi_loader/efi_file.c @@ -235,6 +235,9 @@ static struct efi_file_handle *file_open(struct file_system *fs, } else { fh->isdir = 1; strcpy(fh->path, ""); + + if (set_blk_dev(fh)) + goto error; } return &fh->base;