diff options
author | Star Zeng <star.zeng@intel.com> | 2016-03-07 14:01:46 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2016-03-08 18:05:16 +0800 |
commit | efef6ad6d7487606782a5d4aa09656fb606129d6 (patch) | |
tree | 9c4f080ec7109495b1f89c4a70015367d03da98a /MdeModulePkg/Universal | |
parent | ace1d0517b656a6d15484e875d73c0fe661ac8c7 (diff) | |
download | edk2-platforms-efef6ad6d7487606782a5d4aa09656fb606129d6.tar.xz |
MdeModulePkg AcpiTableDxe: Use Rsdt to check against NULL
Some static scan tool may regard CurrentRsdtEntry to be potentially
referenced to NULL pointer if CurrentRsdtEntry == NULL is used in
the right above if condition judgment.
CopyMem (CurrentRsdtEntry, CurrentRsdtEntry + 1, (*NumberOfTableEntries - Index) * sizeof (UINT32));
It is introduced by commit f9bbb8d9c3f065faba9f266cf4e731fe2ca70c4d.
To avoid it and have same style with
"((Xsdt == NULL) || CurrentTablePointer64 == (UINT64) (UINTN) Table->Table)",
use Rsdt instead of CurrentRsdtEntry to check against NULL.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Shumin Qiu <shumin.qiu@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r-- | MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c index f6229ca05c..7f95b9dc70 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c @@ -1,7 +1,7 @@ /** @file
ACPI Table Protocol Implementation
- Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -1132,7 +1132,7 @@ RemoveTableFromRsdt ( //
// Check if we have found the corresponding entry in both RSDT and XSDT
//
- if ((CurrentRsdtEntry == NULL || *CurrentRsdtEntry == (UINT32) (UINTN) Table->Table) &&
+ if (((Rsdt == NULL) || *CurrentRsdtEntry == (UINT32) (UINTN) Table->Table) &&
((Xsdt == NULL) || CurrentTablePointer64 == (UINT64) (UINTN) Table->Table)
) {
//
|