Fix a critical bug: When reading block succeeds but detecting MBR fails, it should return error code instead of EFI_SUCCESS.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2483 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8 2007-03-16 09:24:10 +00:00
parent bb60dd97af
commit 3c17ed18fa
1 changed files with 4 additions and 1 deletions

View File

@ -162,10 +162,13 @@ Returns:
BlockIo->Media->BlockSize,
Mbr
);
if (EFI_ERROR (Status) || !PartitionValidMbr (Mbr, BlockIo->Media->LastBlock)) {
if (EFI_ERROR (Status)) {
Found = Status;
goto Done;
}
if (!PartitionValidMbr (Mbr, BlockIo->Media->LastBlock)) {
goto Done;
}
//
// We have a valid mbr - add each partition
//