From: ydong10 Date: Thu, 21 Feb 2013 05:54:24 +0000 (+0000) Subject: Refine the code to avoid error report. X-Git-Tag: edk2-stable201903~12702 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=9bdcf582d178629e81cc109e274a63c8c668d6df Refine the code to avoid error report. Signed-off-by: Eric Dong Reviewed-by: Ni Ruiyu git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14143 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBus.c b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBus.c index 597ada2610..ab2ec8071a 100644 --- a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBus.c +++ b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBus.c @@ -3,7 +3,7 @@ Child device(Disk, CDROM, etc) enumeration and child handler installation, and driver stop. - Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -719,6 +719,7 @@ IDEBusDriverBindingStart ( // for (IdeDevice = BeginningIdeDevice; IdeDevice <= EndIdeDevice; IdeDevice++) { + ASSERT (IdeChannel * 2 + IdeDevice < MAX_IDE_DEVICE); if (IdeBusDriverPrivateData->DeviceProcessed[IdeChannel * 2 + IdeDevice]) { continue; } @@ -738,6 +739,7 @@ IDEBusDriverBindingStart ( continue; } + ASSERT (IdeChannel < IdeMaxChannel && IdeDevice < IdeMaxDevice); IdeBlkIoDevicePtr = IdeBlkIoDevice[IdeChannel][IdeDevice]; // diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c index 873cf2519a..742cdc1931 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c @@ -2,7 +2,7 @@ Usb Bus Driver Binding and Bus IO Protocol. -Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -964,6 +964,7 @@ UsbBusBuildProtocol ( // The EFI_USB2_HC_PROTOCOL is produced for XHCI support. // Then its max supported devices are 256. Otherwise it's 128. // + ASSERT (UsbBus->Usb2Hc != NULL); if (UsbBus->Usb2Hc->MajorRevision == 0x3) { UsbBus->MaxDevices = 256; }