diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-03-16 09:24:10 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-03-16 09:24:10 +0000 |
commit | 3c17ed18fa4b3fd08bdeda720cc0496b48ebf331 (patch) | |
tree | bb9349c867a23164cc7036ec9921a4b93749550a /EdkModulePkg/Universal | |
parent | bb60dd97af4e377073e2c6700830897405f232bd (diff) | |
download | edk2-platforms-3c17ed18fa4b3fd08bdeda720cc0496b48ebf331.tar.xz |
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
Diffstat (limited to 'EdkModulePkg/Universal')
-rw-r--r-- | EdkModulePkg/Universal/Disk/Partition/Dxe/Mbr.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/EdkModulePkg/Universal/Disk/Partition/Dxe/Mbr.c b/EdkModulePkg/Universal/Disk/Partition/Dxe/Mbr.c index cf790d45e3..d71698c826 100644 --- a/EdkModulePkg/Universal/Disk/Partition/Dxe/Mbr.c +++ b/EdkModulePkg/Universal/Disk/Partition/Dxe/Mbr.c @@ -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
//
|