MdeModulePkg/FvSimpleFileSystem: fix assertions when FV is empty
The original code will assert when dealing with those empty FVs. The fix is used to solve this bug. Cc: Chao Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
This commit is contained in:
@ -223,7 +223,11 @@ FvSimpleFileSystemOpenVolume (
|
||||
}
|
||||
}
|
||||
|
||||
Instance->Root->DirReadNext = FVFS_GET_FIRST_FILE_INFO (Instance);
|
||||
Instance->Root->DirReadNext = NULL;
|
||||
if (!IsListEmpty (&Instance->FileInfoHead)) {
|
||||
Instance->Root->DirReadNext = FVFS_GET_FIRST_FILE_INFO (Instance);
|
||||
}
|
||||
|
||||
*RootFile = &Instance->Root->FileProtocol;
|
||||
return Status;
|
||||
}
|
||||
|
Reference in New Issue
Block a user