diff options
author | hfang <hfang@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-21 06:33:31 +0000 |
---|---|---|
committer | hfang <hfang@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-21 06:33:31 +0000 |
commit | aa950314c706c55c0f4a32c41752bf5a19e8deb4 (patch) | |
tree | 10916e846d3f0b91b4407d653dea18168c4ef3f3 /IntelFrameworkModulePkg/Bus/Pci | |
parent | 55deb97841fa6b6a0ee491a26ca801dd31a3e7bb (diff) | |
download | edk2-platforms-aa950314c706c55c0f4a32c41752bf5a19e8deb4.tar.xz |
Fix K8 report bugs.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8139 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Bus/Pci')
-rw-r--r-- | IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ide.c | 4 | ||||
-rw-r--r-- | IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBus.c | 13 | ||||
-rw-r--r-- | IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c | 6 |
3 files changed, 20 insertions, 3 deletions
diff --git a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ide.c b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ide.c index 6ffc2fcf2b..ed02b38dcf 100644 --- a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ide.c +++ b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ide.c @@ -373,6 +373,10 @@ ReassignIdeResources ( UINT16 CommandBlockBaseAddr;
UINT16 ControlBlockBaseAddr;
+ if (IdeDev->Channel >= IdeMaxChannel) {
+ return EFI_INVALID_PARAMETER;
+ }
+
//
// Requery IDE IO port registers' base addresses in case of the switch of
// native and legacy modes
diff --git a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBus.c b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBus.c index fb86e55480..b09bb8a53f 100644 --- a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBus.c +++ b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBus.c @@ -360,6 +360,14 @@ IDEBusDriverBindingStart ( EndIdeChannel = BeginningIdeChannel;
BeginningIdeDevice = Node->Atapi.SlaveMaster;
EndIdeDevice = BeginningIdeDevice;
+ if (BeginningIdeChannel >= IdeMaxChannel || EndIdeChannel >= IdeMaxChannel) {
+ Status = EFI_INVALID_PARAMETER;
+ goto ErrorExit;
+ }
+ if (BeginningIdeDevice >= IdeMaxDevice|| EndIdeDevice >= IdeMaxDevice) {
+ Status = EFI_INVALID_PARAMETER;
+ goto ErrorExit;
+ }
}
//
@@ -1030,8 +1038,9 @@ DeRegisterIdeDevice ( // Release allocated resources
//
Index = IdeBlkIoDevice->Channel * 2 + IdeBlkIoDevice->Device;
- IdeBlkIoDevice->IdeBusDriverPrivateData->HaveScannedDevice[Index] = FALSE;
-
+ if (Index < MAX_IDE_DEVICE) {
+ IdeBlkIoDevice->IdeBusDriverPrivateData->HaveScannedDevice[Index] = FALSE;
+ }
ReleaseIdeResources (IdeBlkIoDevice);
return EFI_SUCCESS;
diff --git a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c index d461aef4d0..320eb4c62d 100644 --- a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c +++ b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c @@ -1202,7 +1202,11 @@ GetHpcPciAddressFromRootBridge ( return EFI_NOT_FOUND;
}
- *PciAddress = EFI_PCI_ADDRESS (Temp->BusNumber, Temp->DeviceNumber, Temp->FunctionNumber, 0);
+ if (Temp != NULL) {
+ *PciAddress = EFI_PCI_ADDRESS (Temp->BusNumber, Temp->DeviceNumber, Temp->FunctionNumber, 0);
+ } else {
+ return EFI_NOT_FOUND;
+ }
return EFI_SUCCESS;
|