]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c
OvmfPkg: replace old EFI_D_ debug levels with new DEBUG_ ones
[mirror_edk2.git] / OvmfPkg / Library / BasePciCapLib / BasePciCapLib.c
index 8b049889622caaa2190d3363abbeed486612ee1a..c6f2c726509f33aa1958fd7cfa3cd1d6110845a7 100644 (file)
@@ -6,13 +6,7 @@
 \r
   Copyright (C) 2018, Red Hat, Inc.\r
 \r
-  This program and the accompanying materials are licensed and made available\r
-  under the terms and conditions of the BSD License which accompanies this\r
-  distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
-  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 **/\r
 \r
 #include <IndustryStandard/PciExpress21.h>\r
@@ -309,6 +303,13 @@ InsertPciCap (
   // not the first instance of (Domain, CapId).\r
   //\r
   if (PciCap->Key.Instance > 0) {\r
+    //\r
+    // Suppress invalid "nullptr dereference" compiler/analyzer warnings: the\r
+    // only way for "PciCap->Key.Instance" to be positive here is for it to\r
+    // have been assigned *from* dereferencing "InstanceZero" above.\r
+    //\r
+    ASSERT (InstanceZero != NULL);\r
+\r
     InstanceZero->NumInstancesUnion.NumInstances++;\r
   }\r
   return RETURN_SUCCESS;\r