Signed-off-by: Radoslav Kolev <[email protected]>
---
 grub-core/commands/blsuki.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/grub-core/commands/blsuki.c b/grub-core/commands/blsuki.c
index db5ab3a5c..c7e8921d0 100644
--- a/grub-core/commands/blsuki.c
+++ b/grub-core/commands/blsuki.c
@@ -106,6 +106,7 @@ struct read_entry_info
   const char *dirname;
   enum blsuki_cmd_type cmd_type;
   grub_file_t file;
+  bool entry_found;
 };
 
 struct find_entry_info
@@ -635,7 +636,10 @@ blsuki_read_entry (const char *filename,
 #endif
 
   if (err == GRUB_ERR_NONE)
-    blsuki_add_entry (entry);
+    {
+      blsuki_add_entry (entry);
+      info->entry_found = true;
+    }
   else
     grub_free (entry);
 
@@ -1200,6 +1204,7 @@ blsuki_find_entry (struct find_entry_info *info, bool 
enable_fallback, enum blsu
       dir_fs = info->fs;
       read_entry_info.devid = info->devid;
       read_entry_info.cmd_type = cmd_type;
+      read_entry_info.entry_found = false;
 
       r = dir_fs->fs_dir (dir_dev, read_entry_info.dirname, blsuki_read_entry,
                          &read_entry_info);
@@ -1215,7 +1220,7 @@ blsuki_find_entry (struct find_entry_info *info, bool 
enable_fallback, enum blsu
        * can find the files there. If we can't find UKI entries, fallback to
        * "/EFI/Linux" on the EFI system partition.
        */
-      if (entries == NULL && fallback == false && enable_fallback == true)
+      if ( read_entry_info.entry_found == false && fallback == false && 
enable_fallback == true)
        {
          if (cmd_type == BLSUKI_BLS_CMD)
            cmd_dir = GRUB_BLS_CONFIG_PATH;
-- 
2.51.1


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to