MdeModulePkg/PciBusDxe: cope with HPCs that request no bus nr padding
authorRuiyu Ni <ruiyu.ni@intel.com>
Mon, 8 Jan 2018 07:51:00 +0000 (15:51 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Mon, 8 Jan 2018 07:59:29 +0000 (15:59 +0800)
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c

index 8b076e8..a3a5829 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Internal library implementation for PCI Bus module.\r
 \r
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
 (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -1154,11 +1154,20 @@ PciScanBus (
 \r
               FreePool (Descriptors);\r
 \r
-              if (EFI_ERROR (Status)) {\r
-                return Status;\r
-              }\r
+              switch (Status) {\r
+                case EFI_SUCCESS:\r
+                  BusPadding = TRUE;\r
+                  break;\r
 \r
-              BusPadding = TRUE;\r
+                case EFI_NOT_FOUND:\r
+                  //\r
+                  // no bus number padding requested\r
+                  //\r
+                  break;\r
+\r
+                default:\r
+                  return Status;\r
+              }\r
             }\r
           }\r
         }\r