Fix K8 report bugs.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8139 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
hfang
2009-04-21 06:33:31 +00:00
parent 55deb97841
commit aa950314c7
5 changed files with 74 additions and 35 deletions

View File

@ -1065,6 +1065,11 @@ IsaIoMap_FullSupport (
if (Operation < 0 || Operation >= EfiIsaIoOperationMaximum) {
return EFI_INVALID_PARAMETER;
}
if (ChannelNumber >= 8) {
return EFI_INVALID_PARAMETER;
}
//
// See if this is a Slave DMA Operation
//

View File

@ -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

View File

@ -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;

View File

@ -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;