aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt2018-10-01 22:57:32 -0500
committerAlexander Graf2018-10-16 09:39:57 -0500
commit2c61e0cc5c67345d2d3e4a66f6e22899afa381cc (patch)
treedab61b15eff79f52607f8a6bdc0bc75833e22cca /lib
parent6f566c231d93050e9366bc32067fdecd2aa8d8c6 (diff)
downloadu-boot-2c61e0cc5c67345d2d3e4a66f6e22899afa381cc.tar.gz
u-boot-2c61e0cc5c67345d2d3e4a66f6e22899afa381cc.tar.xz
u-boot-2c61e0cc5c67345d2d3e4a66f6e22899afa381cc.zip
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 <trini@konsulko.com> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_file.c9
1 files changed, 8 insertions, 1 deletions
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)
52 return fs_set_blk_dev_with_part(fh->fs->desc, fh->fs->part); 52 return fs_set_blk_dev_with_part(fh->fs->desc, fh->fs->part);
53} 53}
54 54
55/**
56 * is_dir() - check if file handle points to directory
57 *
58 * We assume that set_blk_dev(fh) has been called already.
59 *
60 * @fh: file handle
61 * Return: true if file handle points to a directory
62 */
55static int is_dir(struct file_handle *fh) 63static int is_dir(struct file_handle *fh)
56{ 64{
57 struct fs_dir_stream *dirs; 65 struct fs_dir_stream *dirs;
58 66
59 set_blk_dev(fh);
60 dirs = fs_opendir(fh->path); 67 dirs = fs_opendir(fh->path);
61 if (!dirs) 68 if (!dirs)
62 return 0; 69 return 0;