From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109108+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109108+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1695795430; cv=none; d=zohomail.com; s=zohoarc; b=Ohhgb30RqpCHyya24uqEAagKU9YK4L51YSY7jcA8uvvjg/ZfvI9YlIGwBdhW7gHohLbNjLY6AfYxS3FwzDVEF53SzAM5GmtwU3HqR1DuyAz4kJ8R2bgmZ+4Ah/FqHwJYZQ26sqr1FsfY6dYZFtmuLcXcOoRqgxEz3+NNUL5UhMw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695795430; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=eAt09ip9rVRZ0tFzpahqHDxRXrdP15MYH6AOwtn/rkc=; b=Ip1FGHI4Vli1tHYGxx3PLOA24sMSt9/EY7YtsERp9ROuIvzw4cJm9Tez+Gp6EbMHM9vGhwXLqAO7QZjt7kP0OXchkvFP95EvWr/6wzojJO3/YZj0LhN/XOtnfxWpMkGZi5i1PffwTxOUFZQZ8gybIfEvMg65V+6OwgU6pPSX8gs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109108+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1695795430670950.8573620429422; Tue, 26 Sep 2023 23:17:10 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=ZgOzrBYnYfk6O/dFk2/uXygAa+Zc5RBYxzsWW81pCQw=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1695795430; v=1; b=ZW30kvPmyzQeeL0SznD0q2tUSbejj/U64G1UuZtOE/voTmqFqLIY2ctXHg8hYLo5xB12cN6L htZz0Xpk4Vsx1ePmhIKBS/uRX1tFU2eb7fJcJ4N13LZaOD/o696R4AJPHLRzD4hIKZ8ZvJF8lSw S7Mtnd6h1IY8Kpk5J3XRWnv0= X-Received: by 127.0.0.2 with SMTP id RBU6YY1788612x1KwgKAe3X9; Tue, 26 Sep 2023 23:17:10 -0700 X-Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by mx.groups.io with SMTP id smtpd.web10.11689.1695795429774258679 for ; Tue, 26 Sep 2023 23:17:09 -0700 X-Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7a25040faffso6719739f.1 for ; Tue, 26 Sep 2023 23:17:09 -0700 (PDT) X-Gm-Message-State: sJO8SDdB5KwUDMPbm90BvJbmx1787277AA= X-Google-Smtp-Source: AGHT+IGfx22+GgZf8nqdVJMxEiBRYbbTh+B+sbKea220HIDevNi1QI/v7am+hRANm5dQ6BMbWbeO1Q== X-Received: by 2002:a6b:f012:0:b0:79f:d195:5384 with SMTP id w18-20020a6bf012000000b0079fd1955384mr1307247ioc.17.1695795428922; Tue, 26 Sep 2023 23:17:08 -0700 (PDT) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([106.51.83.242]) by smtp.gmail.com with ESMTPSA id o23-20020a6b5a17000000b007836c7e8dccsm2571625iob.17.2023.09.26.23.17.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 23:17:08 -0700 (PDT) From: "Ranbir Singh" To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Hao A Wu , Ray Ni , Veeresh Sangolli Subject: [edk2-devel] [PATCH v1 1/5] MdeModulePkg/Bus/Pci/PciBusDxe: Fix DEADCODE Coverity issue Date: Wed, 27 Sep 2023 11:46:57 +0530 Message-Id: <20230927061701.451202-2-rsingh@ventanamicro.com> In-Reply-To: <20230927061701.451202-1-rsingh@ventanamicro.com> References: <20230927061701.451202-1-rsingh@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rsingh@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695795432219100007 Content-Type: text/plain; charset="utf-8" From: Ranbir Singh The function PciHotPlugRequestNotify has two if blocks towards the end of function both containing return. Due to the parameter checks ensured at the beginning of the function, one of the two if blocks is bound to come in execution flow. Hence, the return EFI_SUCCESS; at line 2112 is redundant/deadcode. To fix it, either of line 2109 or 2112 can be deleted. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4239 Cc: Hao A Wu Cc: Ray Ni Co-authored-by: Veeresh Sangolli Signed-off-by: Ranbir Singh Signed-off-by: Ranbir Singh --- MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c | 1 - 1 file changed, 1 deletion(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c b/MdeModulePkg/= Bus/Pci/PciBusDxe/PciEnumerator.c index 3f8c6e6da7dc..5b71e152f3ea 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c @@ -2106,7 +2106,6 @@ PciHotPlugRequestNotify ( // // End for // - return EFI_SUCCESS; } =20 return EFI_SUCCESS; --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109108): https://edk2.groups.io/g/devel/message/109108 Mute This Topic: https://groups.io/mt/101612807/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109109+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109109+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1695795433; cv=none; d=zohomail.com; s=zohoarc; b=HbV8/DTJDP3F2fhLhW8N/YIjeKncGSKSQObGGjqsgA22jKQvU2j+H410kLt6Yuo4pVlDcLpxdj9JxCUOyHIxuGBLzm+pA/2r4j0iYIdxmKv9s1CehXUyYuK7hC3D5rKUFEmi9+FU6qcwsjVv/DAA6pJ4OUxfuE+5BImqUh0sin0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695795433; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Kw3nsGdpBb79osv5XuMzM3YqlsyYPQBqv7HutxIppM0=; b=VVN+7EgSvhuMKmSM3DrSfaAgppO9J9J0bFQBGPVtlLCXrSpdvylpQc+tWTfwA8XgHbXK/I+pp+6CSh4qMD1r4tOO1I0978SbVGG8B1WfmZ7UuONSWU2OQF3Fg5uf4AjpFqAUJbebrLQ6CNNLTgH38hUmuPdzC9D63LWgOm8ESu0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109109+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1695795433328707.0861520686528; Tue, 26 Sep 2023 23:17:13 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=N2d+RSTBBrVuRtispSUtX876LDv53N//poBqeDcY9vE=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1695795433; v=1; b=cYmhzjikUkmEQAgKeqZM5NSbwTGp3dwT27uaoNA4xV1/FlMdBbxElG+TdwHPkh2DsXe5pa34 0ns+P55LvWCVBnda3S8aDSHuLW7u8wZ4+Ty2bfts88qJzshceVX3GnpUaiUpuAaBNVmTBgiZCL4 UUof3W9jsYzjoAO54jPZPCRs= X-Received: by 127.0.0.2 with SMTP id LqUhYY1788612xXnoH3YzlP8; Tue, 26 Sep 2023 23:17:13 -0700 X-Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by mx.groups.io with SMTP id smtpd.web11.11916.1695795432389389929 for ; Tue, 26 Sep 2023 23:17:12 -0700 X-Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-79fb70402a7so245310339f.0 for ; Tue, 26 Sep 2023 23:17:12 -0700 (PDT) X-Gm-Message-State: Git8EBdOYBOoGKNVlUFNfWZYx1787277AA= X-Google-Smtp-Source: AGHT+IHZUsD7m0SvVIMxqR1qyuowp2ZhjnNakqNEMlAAVBCFO6Obrlvw/IW/fRVXh9M2FB9XRMb0NA== X-Received: by 2002:a6b:dd07:0:b0:783:4e11:76d7 with SMTP id f7-20020a6bdd07000000b007834e1176d7mr937971ioc.21.1695795431478; Tue, 26 Sep 2023 23:17:11 -0700 (PDT) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([106.51.83.242]) by smtp.gmail.com with ESMTPSA id o23-20020a6b5a17000000b007836c7e8dccsm2571625iob.17.2023.09.26.23.17.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 23:17:11 -0700 (PDT) From: "Ranbir Singh" To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Hao A Wu , Ray Ni , Veeresh Sangolli Subject: [edk2-devel] [PATCH v1 2/5] MdeModulePkg/Bus/Pci/PciBusDxe: Fix MISSING_BREAK Coverity issues Date: Wed, 27 Sep 2023 11:46:58 +0530 Message-Id: <20230927061701.451202-3-rsingh@ventanamicro.com> In-Reply-To: <20230927061701.451202-1-rsingh@ventanamicro.com> References: <20230927061701.451202-1-rsingh@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rsingh@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695795434219100010 Content-Type: text/plain; charset="utf-8" From: Ranbir Singh The function UpdatePciInfo has switch-case code in which there are fall through from case 32: to case 64:. While this is seeemingly intentional, it is not evident to any static analyzer tool. Just adding // No break; here as this is an intentional fallthrough. as explicit comment in between makes a reader as well as Coverity happy. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4239 Cc: Hao A Wu Cc: Ray Ni Co-authored-by: Veeresh Sangolli Signed-off-by: Ranbir Singh Signed-off-by: Ranbir Singh --- MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeMod= ulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c index 6594b8eae83f..eda97285ee18 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c @@ -1428,6 +1428,9 @@ UpdatePciInfo ( switch (Ptr->AddrSpaceGranularity) { case 32: PciIoDevice->PciBar[BarIndex].BarType =3D PciBarTypeMem3= 2; + // + // No break; here as this is an intentional fall through. + // case 64: PciIoDevice->PciBar[BarIndex].BarTypeFixed =3D TRUE; break; @@ -1440,6 +1443,9 @@ UpdatePciInfo ( switch (Ptr->AddrSpaceGranularity) { case 32: PciIoDevice->PciBar[BarIndex].BarType =3D PciBarTypePMem= 32; + // + // No break; here as this is an intentional fall through. + // case 64: PciIoDevice->PciBar[BarIndex].BarTypeFixed =3D TRUE; break; --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109109): https://edk2.groups.io/g/devel/message/109109 Mute This Topic: https://groups.io/mt/101612808/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109110+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109110+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1695795436; cv=none; d=zohomail.com; s=zohoarc; b=MceqtwHATPZTpRFhvpyaaePvcUYLfwAq8rrxNyQY9L/+1iNZ5TJyFtZ6d1MhFOI5twSGQ4BWL9ZzJ8gHLTx8LArAVJoQ+0v3xBN6hFFXHX3Z3sK5PdGqDqjFyOdk9PZ/O+C5LBFhkW+n41F/n7Thz7Zua3QiIPw/aCQX1Svg+b8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695795436; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=5LrCwOZnoq6lcAI2H+KShpUAHKo3eW8e8ME5nr+PGms=; b=YBTTuwbuakUcviZsPaZ98+PeLVDwZ2yTsppNgZo36laX/qVw/7etxTvEdaUFaZ3mCSFncU+LYZp8IpIt1aXf6je1GVzP/JcDjUJDVLTWpSdagCpxznQUj2hCwhHFGxdwF7MXL+IoWc0xFCjr+rj6ZlCPR/czYfa/3310xTDnQZU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109110+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 169579543590141.17965849344387; Tue, 26 Sep 2023 23:17:15 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=l/d+UepkDdeJOOGatSy1I6f8S9zZjYikZXPpoeBYjd4=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1695795435; v=1; b=mHJFutdfXNAHR7r4MsBX4JRV+2/ApW3vOWzrdrTefFPNSwG7pTUuKWuLWHYFf0R0+TV1DbjI dKFPStPYOwl+GTwMs49npZJPllNoOcPh+df5LrQbVbQcfvD3RBKiu5nGBoPQnlh9m3zzE3pcKqB rfphY9VSw1MWZCnWGSFBPvVo= X-Received: by 127.0.0.2 with SMTP id CFJ1YY1788612xOJ6NSkJ6qD; Tue, 26 Sep 2023 23:17:15 -0700 X-Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by mx.groups.io with SMTP id smtpd.web11.11919.1695795434958660080 for ; Tue, 26 Sep 2023 23:17:15 -0700 X-Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-79f989480e0so326553339f.3 for ; Tue, 26 Sep 2023 23:17:14 -0700 (PDT) X-Gm-Message-State: SQBR3hCeqgJyOWXnXyYNvEcCx1787277AA= X-Google-Smtp-Source: AGHT+IGEQahJ3ZlAC0xy7CQUR4xZpj/p1cvY5pTmsHUE+K7hyutBZEiX0OsAIS24nSgRwKPxmafmUQ== X-Received: by 2002:a6b:5b1a:0:b0:787:1472:3181 with SMTP id v26-20020a6b5b1a000000b0078714723181mr1274147ioh.3.1695795434012; Tue, 26 Sep 2023 23:17:14 -0700 (PDT) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([106.51.83.242]) by smtp.gmail.com with ESMTPSA id o23-20020a6b5a17000000b007836c7e8dccsm2571625iob.17.2023.09.26.23.17.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 23:17:13 -0700 (PDT) From: "Ranbir Singh" To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Hao A Wu , Ray Ni , Veeresh Sangolli Subject: [edk2-devel] [PATCH v1 3/5] MdeModulePkg/Bus/Pci/PciBusDxe: Fix ARRAY_VS_SINGLETON Coverity issues Date: Wed, 27 Sep 2023 11:46:59 +0530 Message-Id: <20230927061701.451202-4-rsingh@ventanamicro.com> In-Reply-To: <20230927061701.451202-1-rsingh@ventanamicro.com> References: <20230927061701.451202-1-rsingh@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rsingh@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695795436966100001 Content-Type: text/plain; charset="utf-8" From: Ranbir Singh The function PciHostBridgeResourceAllocator is not making use of the generic approach as is used in one of the other function namely - DumpResourceMap. As a result, the following warnings can be seen as reported by Coverity e.g. (30) Event address_of: Taking address with "&IoBridge" yields a singleton pointer. (31) Event callee_ptr_arith: Passing "&IoBridge" to function "FindResourceNode" which uses it as an array. This might corrupt or misinterpret adjacent memory locations. Hence, adopt the generic approach to fix the issues at relevant points. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4239 Cc: Hao A Wu Cc: Ray Ni Co-authored-by: Veeresh Sangolli Signed-off-by: Ranbir Singh Signed-off-by: Ranbir Singh --- MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c | 37 ++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c b/MdeModulePkg/Bus/Pci= /PciBusDxe/PciLib.c index 84fc0161a19c..71767d3793d4 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c @@ -485,6 +485,8 @@ PciHostBridgeResourceAllocator ( UINT64 Mem64ResStatus; UINT64 PMem64ResStatus; UINT32 MaxOptionRomSize; + PCI_RESOURCE_NODE **ChildResources; + UINTN ChildResourceCount; PCI_RESOURCE_NODE *IoBridge; PCI_RESOURCE_NODE *Mem32Bridge; PCI_RESOURCE_NODE *PMem32Bridge; @@ -895,16 +897,39 @@ PciHostBridgeResourceAllocator ( // Create the entire system resource map from the information collecte= d by // enumerator. Several resource tree was created // - FindResourceNode (RootBridgeDev, &IoPool, &IoBridge); - FindResourceNode (RootBridgeDev, &Mem32Pool, &Mem32Bridge); - FindResourceNode (RootBridgeDev, &PMem32Pool, &PMem32Bridge); - FindResourceNode (RootBridgeDev, &Mem64Pool, &Mem64Bridge); - FindResourceNode (RootBridgeDev, &PMem64Pool, &PMem64Bridge); - + ChildResourceCount =3D FindResourceNode (RootBridgeDev, &IoPool, NULL); + ChildResources =3D AllocatePool (sizeof (PCI_RESOURCE_NODE *) * ChildR= esourceCount); + ASSERT (ChildResources !=3D NULL); + FindResourceNode (RootBridgeDev, &IoPool, &ChildResources[0]); + IoBridge =3D ChildResources[0]; ASSERT (IoBridge !=3D NULL); + + ChildResourceCount =3D FindResourceNode (RootBridgeDev, &Mem32Pool, NU= LL); + ChildResources =3D AllocatePool (sizeof (PCI_RESOURCE_NODE *) * ChildR= esourceCount); + ASSERT (ChildResources !=3D NULL); + FindResourceNode (RootBridgeDev, &Mem32Pool, &ChildResources[0]); + Mem32Bridge =3D ChildResources[0]; ASSERT (Mem32Bridge !=3D NULL); + + ChildResourceCount =3D FindResourceNode (RootBridgeDev, &PMem32Pool, N= ULL); + ChildResources =3D AllocatePool (sizeof (PCI_RESOURCE_NODE *) * ChildR= esourceCount); + ASSERT (ChildResources !=3D NULL); + FindResourceNode (RootBridgeDev, &PMem32Pool, &ChildResources[0]); + PMem32Bridge =3D ChildResources[0]; ASSERT (PMem32Bridge !=3D NULL); + + ChildResourceCount =3D FindResourceNode (RootBridgeDev, &Mem64Pool, NU= LL); + ChildResources =3D AllocatePool (sizeof (PCI_RESOURCE_NODE *) * ChildR= esourceCount); + ASSERT (ChildResources !=3D NULL); + FindResourceNode (RootBridgeDev, &Mem64Pool, &ChildResources[0]); + Mem64Bridge =3D ChildResources[0]; ASSERT (Mem64Bridge !=3D NULL); + + ChildResourceCount =3D FindResourceNode (RootBridgeDev, &PMem64Pool, N= ULL); + ChildResources =3D AllocatePool (sizeof (PCI_RESOURCE_NODE *) * ChildR= esourceCount); + ASSERT (ChildResources !=3D NULL); + FindResourceNode (RootBridgeDev, &PMem64Pool, &ChildResources[0]); + PMem64Bridge =3D ChildResources[0]; ASSERT (PMem64Bridge !=3D NULL); =20 // --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109110): https://edk2.groups.io/g/devel/message/109110 Mute This Topic: https://groups.io/mt/101612809/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109111+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109111+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1695795438; cv=none; d=zohomail.com; s=zohoarc; b=h2zC5kH33lEf2JWsI69XfRy73AqmC8a0CzkCTUpSoHIgHg22Bz7UO4qKFeTYBu+NEtqf73tSrlbK1D44No6BfA8k6PpH5MH7RVJOIR7guW8xO/JGoW+iByM2Wq0VGeek8kj4xRVp29NFWF5RZzmQqnlxJ8W0//qXvtY8/lHD5XQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695795438; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ZE9xhpl5t2YDgq201+Usqqzsecw7ELM9mn2rvYsTs+I=; b=P8nBbhuFBrGHXjc6XQunb8YBvhjaojDiNNRFVpEFY1y7AZ38o2GbinhBtrH8SeSTx8nSf/TdEmiC2Qw4w2LAdVsow7oXrOjMq2aLMbIUUlTYzAP0gxfWuPcjBFMC7FP4sgqNnBa0w0dmKVv41I96KCAJHcL13soGGbRBa46zJA0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109111+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1695795438359266.59793850707354; Tue, 26 Sep 2023 23:17:18 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=kxRDzPnxhmpZH4IZft2JLovGsyiEYx19cQL/bexhIrs=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1695795438; v=1; b=bXwV08vZe45WK81IcVdodwuJu3spus0oI/6bJkuXzKXXz7YyXw/UJteJu0kde0PEwWxYr1uV QIWOcIDzF1ASZdqxvjlWL0Lrsxh4Nk3GyGhgJh+uEKMojefi1u+lpYYvToDRSEWSfDqfPEnYWL9 BE/wj9SIrNAA/JXz0ah9+InY= X-Received: by 127.0.0.2 with SMTP id k9YoYY1788612xL5Hd1vfsqY; Tue, 26 Sep 2023 23:17:18 -0700 X-Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by mx.groups.io with SMTP id smtpd.web10.11692.1695795437434332916 for ; Tue, 26 Sep 2023 23:17:17 -0700 X-Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-79f915e5b47so356663139f.2 for ; Tue, 26 Sep 2023 23:17:17 -0700 (PDT) X-Gm-Message-State: 9VgCyxNFB3iXM5vqs8NE0t5mx1787277AA= X-Google-Smtp-Source: AGHT+IELsGBLrm9faq0hp4PTw25pMs+bgQwqy6+GBNlDPjUnPWhiJPfT9ZON1McfemuraV7OOnyMDA== X-Received: by 2002:a6b:dd07:0:b0:790:fa58:69d2 with SMTP id f7-20020a6bdd07000000b00790fa5869d2mr1008146ioc.20.1695795436530; Tue, 26 Sep 2023 23:17:16 -0700 (PDT) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([106.51.83.242]) by smtp.gmail.com with ESMTPSA id o23-20020a6b5a17000000b007836c7e8dccsm2571625iob.17.2023.09.26.23.17.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 23:17:16 -0700 (PDT) From: "Ranbir Singh" To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Hao A Wu , Ray Ni , Veeresh Sangolli Subject: [edk2-devel] [PATCH v1 4/5] MdeModulePkg/Bus/Pci/PciBusDxe: Fix NULL_RETURNS Coverity issue Date: Wed, 27 Sep 2023 11:47:00 +0530 Message-Id: <20230927061701.451202-5-rsingh@ventanamicro.com> In-Reply-To: <20230927061701.451202-1-rsingh@ventanamicro.com> References: <20230927061701.451202-1-rsingh@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rsingh@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695795438951100005 Content-Type: text/plain; charset="utf-8" From: Ranbir Singh The function StartPciDevices has a check ASSERT (RootBridge !=3D NULL); but this comes into play only in DEBUG mode. In Release mode, there is no handling if the RootBridge value is NULL and the code proceeds to unconditionally dereference "RootBridge" which will lead to CRASH. Hence, for safety add NULL pointer checks always and return EFI_NOT_READY if RootBridge value is NULL which is one of the return values as mentioned in the function description header. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4239 Cc: Hao A Wu Cc: Ray Ni Co-authored-by: Veeresh Sangolli Signed-off-by: Ranbir Singh Signed-off-by: Ranbir Singh --- MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModuleP= kg/Bus/Pci/PciBusDxe/PciDeviceSupport.c index 581e9075ad41..f43f10325f16 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c @@ -773,6 +773,11 @@ StartPciDevices ( =20 RootBridge =3D GetRootBridgeByHandle (Controller); ASSERT (RootBridge !=3D NULL); + + if (RootBridge =3D=3D NULL) { + return EFI_NOT_READY; + } + ThisHostBridge =3D RootBridge->PciRootBridgeIo->ParentHandle; =20 CurrentLink =3D mPciDevicePool.ForwardLink; --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109111): https://edk2.groups.io/g/devel/message/109111 Mute This Topic: https://groups.io/mt/101612810/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109112+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109112+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1695795440; cv=none; d=zohomail.com; s=zohoarc; b=SyGJHjXAndmMWsqlp9shQoAo6EmCygk4p4Hxxoa6xMlJyXrrixBbgvkwSv/T1vFN8ph17p3Pg44HIQJfJ2s7fAEAojH7TGag5Tw7Iu/TwgpGmJi0ApNgiGKKwpMRzDAsQFrNOYHHcoOpqdP0MwkJNkDIsE6ttwzEDze1aS6SJNc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695795440; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ssAYmwDcahyll1OB33NpmJ7UoYLGXHvHZtyc2UFY0do=; b=X8gh361uqJNL1cZVS+AwsCzP9Bf0tx+fGAak0/w/JiOolTOcgn5xitA9J9a1+9TPxJq4DDTjcljcxlpxhYo3ajiH6UGW+lr1yqRm2rw1K7kigY64tYCkE+5aICN0vGfrdFeiu/lJ8n3KKOllxHWW/YxGYtMCN1zmgkx60kV3/yQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109112+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1695795440699482.99781048432305; Tue, 26 Sep 2023 23:17:20 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=+O/CjwrFWPpIH3/G1dzWIgpQ9XzT1PBu4uf0UkVt5rg=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1695795440; v=1; b=b8GKmtmSBlycTyw4thSGkkvJ/ZgMGbkRNHnfxlr0LHUaT4748jtGj3n1hUYN3ysQBRmbXHOy m+7sdhg82HoUQ03sP72lPOxcrpnL/hUzwEA5fDLaxbOdWOXVPX/fdDJxhRm61vfxa7bB9BeBqU3 JRvaJWUadu1BmOvJxWM8sqEI= X-Received: by 127.0.0.2 with SMTP id F32SYY1788612x6PuANjYe6H; Tue, 26 Sep 2023 23:17:20 -0700 X-Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) by mx.groups.io with SMTP id smtpd.web10.11693.1695795439658881517 for ; Tue, 26 Sep 2023 23:17:19 -0700 X-Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-7a25040faffso6729139f.1 for ; Tue, 26 Sep 2023 23:17:19 -0700 (PDT) X-Gm-Message-State: MSpJofD8c5h9v7Rm46OXRspMx1787277AA= X-Google-Smtp-Source: AGHT+IGQIEUT7bEG2YXrqMj6ryinfWIQu06ZIMk/4lo5+0eI/QxCnmhhsyNLqjfqExWck34og9ZBrA== X-Received: by 2002:a6b:e510:0:b0:794:eaef:f43e with SMTP id y16-20020a6be510000000b00794eaeff43emr1318610ioc.1.1695795438786; Tue, 26 Sep 2023 23:17:18 -0700 (PDT) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([106.51.83.242]) by smtp.gmail.com with ESMTPSA id o23-20020a6b5a17000000b007836c7e8dccsm2571625iob.17.2023.09.26.23.17.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 23:17:18 -0700 (PDT) From: "Ranbir Singh" To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Hao A Wu , Ray Ni Subject: [edk2-devel] [PATCH v1 5/5] MdeModulePkg/Bus/Pci/PciBusDxe: Fix UNUSED_VALUE Coverity issues Date: Wed, 27 Sep 2023 11:47:01 +0530 Message-Id: <20230927061701.451202-6-rsingh@ventanamicro.com> In-Reply-To: <20230927061701.451202-1-rsingh@ventanamicro.com> References: <20230927061701.451202-1-rsingh@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rsingh@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695795441020100010 Content-Type: text/plain; charset="utf-8" The return value after calls to functions gBS->UninstallMultipleProtocolInterfaces, StartPciDevicesOnBridge, PciPciDeviceInfoCollector, BarExisted, PciRootBridgeIo->Pci.Write, gPciHotPlugInit->InitializeRootHpc and PciRootBridgeP2CProcess is stored in Status, but it is not made of any use and later Status gets overridden. Remove the return value storage in Status or add Status check as seems appropriate at a particular point. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4239 Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Ranbir Singh --- MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c | 68 +++++++++++----= ----- MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 42 ++++++++---- MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c | 8 +++ 3 files changed, 72 insertions(+), 46 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModuleP= kg/Bus/Pci/PciBusDxe/PciDeviceSupport.c index f43f10325f16..ae770d766381 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c @@ -544,12 +544,12 @@ DeRegisterPciDevice ( EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); if (!EFI_ERROR (Status)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - Handle, - &gEfiLoadFile2ProtocolGuid, - &PciIoDevice->LoadFile2, - NULL - ); + gBS->UninstallMultipleProtocolInterfaces ( + Handle, + &gEfiLoadFile2ProtocolGuid, + &PciIoDevice->LoadFile2, + NULL + ); } =20 // @@ -678,19 +678,21 @@ StartPciDevicesOnBridge ( ChildHandleBuffer ); =20 - PciIoDevice->PciIo.Attributes ( - &(PciIoDevice->PciIo), - EfiPciIoAttributeOperationSupported, - 0, - &Supports - ); - Supports &=3D (UINT64)EFI_PCI_DEVICE_ENABLE; - PciIoDevice->PciIo.Attributes ( - &(PciIoDevice->PciIo), - EfiPciIoAttributeOperationEnable, - Supports, - NULL - ); + if (!EFI_ERROR (Status)) { + PciIoDevice->PciIo.Attributes ( + &(PciIoDevice->PciIo), + EfiPciIoAttributeOperationSupported, + 0, + &Supports + ); + Supports &=3D (UINT64)EFI_PCI_DEVICE_ENABLE; + PciIoDevice->PciIo.Attributes ( + &(PciIoDevice->PciIo), + EfiPciIoAttributeOperationEnable, + Supports, + NULL + ); + } =20 return Status; } else { @@ -726,19 +728,21 @@ StartPciDevicesOnBridge ( ChildHandleBuffer ); =20 - PciIoDevice->PciIo.Attributes ( - &(PciIoDevice->PciIo), - EfiPciIoAttributeOperationSupported, - 0, - &Supports - ); - Supports &=3D (UINT64)EFI_PCI_DEVICE_ENABLE; - PciIoDevice->PciIo.Attributes ( - &(PciIoDevice->PciIo), - EfiPciIoAttributeOperationEnable, - Supports, - NULL - ); + if (!EFI_ERROR (Status)) { + PciIoDevice->PciIo.Attributes ( + &(PciIoDevice->PciIo), + EfiPciIoAttributeOperationSupported, + 0, + &Supports + ); + Supports &=3D (UINT64)EFI_PCI_DEVICE_ENABLE; + PciIoDevice->PciIo.Attributes ( + &(PciIoDevice->PciIo), + EfiPciIoAttributeOperationEnable, + Supports, + NULL + ); + } } =20 CurrentLink =3D CurrentLink->ForwardLink; diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeMod= ulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c index eda97285ee18..636885dd189d 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c @@ -2796,6 +2796,20 @@ IsPciDeviceRejected ( // Test its high 32-Bit BAR // Status =3D BarExisted (PciIoDevice, BarOffset, &TestValue, &OldV= alue); + if (EFI_ERROR (Status)) { + // + // Not sure if it is correct to skip the below if (TestValue = =3D=3D OldValue) check in this special scenario. + // If correct, then remove these 11 comment lines eventually. + // If not correct, then replace "continue;" with blank "; // N= othing to do" and also remove these 11 comment lines eventually + // OR + // Remove the newly added if (EFI_ERROR (Status)) { ... } bl= ock completely and change + // Status =3D BarExisted (PciIoDevice, BarOffset, &TestValue= , &OldValue); + // =3D> + // BarExisted (PciIoDevice, BarOffset, &TestValue, &OldValue= ); + // i.e., no return value storage in Status + // + continue; + } if (TestValue =3D=3D OldValue) { return TRUE; } @@ -2861,13 +2875,13 @@ ResetAllPpbBusNumber ( if (!EFI_ERROR (Status) && (IS_PCI_BRIDGE (&Pci))) { Register =3D 0; Address =3D EFI_PCI_ADDRESS (StartBusNumber, Device, Func, 0x18); - Status =3D PciRootBridgeIo->Pci.Read ( - PciRootBridgeIo, - EfiPciWidthUint32, - Address, - 1, - &Register - ); + PciRootBridgeIo->Pci.Read ( + PciRootBridgeIo, + EfiPciWidthUint32, + Address, + 1, + &Register + ); SecondaryBus =3D (UINT8)(Register >> 8); =20 if (SecondaryBus !=3D 0) { @@ -2878,13 +2892,13 @@ ResetAllPpbBusNumber ( // Reset register 18h, 19h, 1Ah on PCI Bridge // Register &=3D 0xFF000000; - Status =3D PciRootBridgeIo->Pci.Write ( - PciRootBridgeIo, - EfiPciWidthUint32, - Address, - 1, - &Register - ); + PciRootBridgeIo->Pci.Write ( + PciRootBridgeIo, + EfiPciWidthUint32, + Address, + 1, + &Register + ); } =20 if ((Func =3D=3D 0) && !IS_PCI_MULTI_FUNC (&Pci)) { diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c b/MdeModulePkg/Bus/Pci= /PciBusDxe/PciLib.c index 71767d3793d4..087fe563c0bc 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c @@ -1250,6 +1250,10 @@ PciScanBus ( &State ); =20 + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_WARN, "Failed to initialize Hotplug PCI Cont= roller, Status %r\n", Status)); + } + PreprocessController ( PciDevice, PciDevice->BusNumber, @@ -1501,6 +1505,10 @@ PciRootBridgeP2CProcess ( =20 if (!IsListEmpty (&Temp->ChildList)) { Status =3D PciRootBridgeP2CProcess (Temp); + + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_WARN, "Failed to process Option Rom on PCI root brid= ge %p, Status %r\n", Temp, Status)); + } } =20 CurrentLink =3D CurrentLink->ForwardLink; --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109112): https://edk2.groups.io/g/devel/message/109112 Mute This Topic: https://groups.io/mt/101612811/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-