]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBus.c
Refine the code to avoid error report.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / IdeBusDxe / IdeBus.c
index 597ada2610fb7c4a357dadbe31d279ca9dce9b7f..ab2ec8071a7e1fb085cbfb28b8eab2cffb31b15c 100644 (file)
@@ -3,7 +3,7 @@
   Child device(Disk, CDROM, etc) enumeration and child handler installation, and \r
   driver stop.\r
     \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -719,6 +719,7 @@ IDEBusDriverBindingStart (
     //\r
     for (IdeDevice = BeginningIdeDevice; IdeDevice <= EndIdeDevice; IdeDevice++) {\r
 \r
+      ASSERT (IdeChannel * 2 + IdeDevice < MAX_IDE_DEVICE);\r
       if (IdeBusDriverPrivateData->DeviceProcessed[IdeChannel * 2 + IdeDevice]) {\r
         continue;\r
       }\r
@@ -738,6 +739,7 @@ IDEBusDriverBindingStart (
         continue;\r
       }\r
 \r
+      ASSERT (IdeChannel < IdeMaxChannel && IdeDevice < IdeMaxDevice);\r
       IdeBlkIoDevicePtr = IdeBlkIoDevice[IdeChannel][IdeDevice];\r
 \r
       //\r