mirror of https://github.com/acidanthera/audk.git
MdeModulePkg: Fixed memory corruption when BlockIo2 is not present
Fixed NULL pointer reference of BlockIo2.Media in partition code. This resulted in the interrupt vector table being corrupted in a legacy (CSM) based system. Signed-off-by: geekboy15a Reviewed-by: mdkinney Reviewed-by: niruiyu Reviewed-by: jljusten git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11711 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
f44e8c16f8
commit
c582ad454b
|
@ -1053,13 +1053,13 @@ PartitionInstallChildHandle (
|
||||||
// for logical partitions.
|
// for logical partitions.
|
||||||
//
|
//
|
||||||
if (Private->BlockIo.Revision >= EFI_BLOCK_IO_PROTOCOL_REVISION2) {
|
if (Private->BlockIo.Revision >= EFI_BLOCK_IO_PROTOCOL_REVISION2) {
|
||||||
Private->BlockIo.Media->LowestAlignedLba = 0;
|
Private->Media.LowestAlignedLba = 0;
|
||||||
Private->BlockIo.Media->LogicalBlocksPerPhysicalBlock = 0;
|
Private->Media.LogicalBlocksPerPhysicalBlock = 0;
|
||||||
Private->BlockIo2.Media->LowestAlignedLba = 0;
|
Private->Media2.LowestAlignedLba = 0;
|
||||||
Private->BlockIo2.Media->LogicalBlocksPerPhysicalBlock = 0;
|
Private->Media2.LogicalBlocksPerPhysicalBlock = 0;
|
||||||
if (Private->BlockIo.Revision >= EFI_BLOCK_IO_PROTOCOL_REVISION3) {
|
if (Private->BlockIo.Revision >= EFI_BLOCK_IO_PROTOCOL_REVISION3) {
|
||||||
Private->BlockIo.Media->OptimalTransferLengthGranularity = 0;
|
Private->Media.OptimalTransferLengthGranularity = 0;
|
||||||
Private->BlockIo2.Media->OptimalTransferLengthGranularity = 0;
|
Private->Media2.OptimalTransferLengthGranularity = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue