diff options
author | Jiewen Yao <jiewen.yao@intel.com> | 2017-10-31 12:07:31 +0800 |
---|---|---|
committer | Jiewen Yao <jiewen.yao@intel.com> | 2017-10-31 12:07:31 +0800 |
commit | b0489b8f3f276932db8aa7af3680b41574bb09f3 (patch) | |
tree | 5c7785e197e531e7d3ed2307d3982601e1279343 /Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib | |
parent | 055bedd1c45770e73a7d2a60b11657af62535c7a (diff) | |
download | edk2-platforms-b0489b8f3f276932db8aa7af3680b41574bb09f3.tar.xz |
Add NULL check for GetPciSegmentInfo()
Suggested-by: Michael A Kubacki <michael.a.kubacki@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib')
-rw-r--r-- | Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckPci.c | 3 | ||||
-rw-r--r-- | Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiCheckPci.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckPci.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckPci.c index 843b23c1ff..3c7e3e3672 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckPci.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckPci.c @@ -404,6 +404,9 @@ TestPointCheckPciBusMaster ( PCI_SEGMENT_INFO *PciSegmentInfo;
PciSegmentInfo = GetPciSegmentInfo (&SegmentCount);
+ if (PciSegmentInfo == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
Status = EFI_SUCCESS;
for (Segment = 0; Segment < SegmentCount; Segment++) {
diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiCheckPci.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiCheckPci.c index 631f2bd122..ae07e5425c 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiCheckPci.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiCheckPci.c @@ -37,6 +37,9 @@ TestPointCheckPciBusMaster ( PCI_SEGMENT_INFO *PciSegmentInfo;
PciSegmentInfo = GetPciSegmentInfo (&SegmentCount);
+ if (PciSegmentInfo == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
Status = EFI_SUCCESS;
for (Segment = 0; Segment < SegmentCount; Segment++) {
|