From 2c61e0cc5c67345d2d3e4a66f6e22899afa381cc Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 2 Oct 2018 05:57:32 +0200 Subject: [PATCH] efi_loader: superfluous statement in is_dir() When is_dir() is called we have already execute set_blk_dev(fh). So don't call it again. This fixes CoverityScan CID 184093. Reported-by: Tom Rini Signed-off-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- lib/efi_loader/efi_file.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c index c1e285e9f7..beb4fba917 100644 --- a/lib/efi_loader/efi_file.c +++ b/lib/efi_loader/efi_file.c @@ -52,11 +52,18 @@ static int set_blk_dev(struct file_handle *fh) return fs_set_blk_dev_with_part(fh->fs->desc, fh->fs->part); } +/** + * is_dir() - check if file handle points to directory + * + * We assume that set_blk_dev(fh) has been called already. + * + * @fh: file handle + * Return: true if file handle points to a directory + */ static int is_dir(struct file_handle *fh) { struct fs_dir_stream *dirs; - set_blk_dev(fh); dirs = fs_opendir(fh->path); if (!dirs) return 0; -- 2.25.1