1. add missing free operation in conditional branch.
2. when variable store header is invalid status, we will return EFI_VOLUME_CORRUPTED to let code assert, which is helpful to find root cause quickly. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7804 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
		@@ -977,6 +977,7 @@ VariableCommonInitialize (
 | 
				
			|||||||
            );
 | 
					            );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (EFI_ERROR (Status)) {
 | 
					  if (EFI_ERROR (Status)) {
 | 
				
			||||||
 | 
					    FreePool(mVariableModuleGlobal);
 | 
				
			||||||
    return Status;
 | 
					    return Status;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  //
 | 
					  //
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1984,6 +1984,9 @@ VariableCommonInitialize (
 | 
				
			|||||||
               NULL, 
 | 
					               NULL, 
 | 
				
			||||||
               &ReadyToBootEvent
 | 
					               &ReadyToBootEvent
 | 
				
			||||||
               );
 | 
					               );
 | 
				
			||||||
 | 
					  } else {
 | 
				
			||||||
 | 
					    Status = EFI_VOLUME_CORRUPTED;
 | 
				
			||||||
 | 
					    DEBUG((EFI_D_INFO, "Variable Store header is corrupted\n"));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Done:
 | 
					Done:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user