diff --git a/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c b/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c index d73d23fe86..9e46e8ab83 100644 --- a/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c +++ b/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c @@ -332,6 +332,12 @@ VirtioFsSimpleFileOpen ( return EFI_INVALID_PARAMETER; } + // + // Set CreateDirectoryIfCreating to suppress incorrect compiler/analyzer + // warnings. + // + CreateDirectoryIfCreating = FALSE; + // // Validate the Attributes requested for the case when the file ends up being // created, provided creation is permitted. @@ -426,6 +432,11 @@ VirtioFsSimpleFileOpen ( goto FreeNewCanonicalPath; } + // + // Set NewNodeIsDirectory to suppress incorrect compiler/analyzer warnings. + // + NewNodeIsDirectory = FALSE; + // // Try to open LastComponent directly under DirNodeId, as an existent regular // file or directory.