MdeModulePkg: fix cast in GetModuleInfoFromHandle() calls

GetModuleInfoFromHandle() takes an EFI_HANDLE -- (VOID*) -- as first
parameter, but InsertFpdtRecord() passes (EFI_HANDLE*) -- (VOID**).
(VOID**) converts silently to (VOID*), which is why the wrong cast is
masked.

Note that the *value* that is passed is alright -- therefore this patch
does not change behavior --, it's just semantically wrong to pass an
(EFI_HANDLE*) where an EFI_HANDLE is expected.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
This commit is contained in:
Laszlo Ersek 2019-09-06 21:40:32 +02:00
parent 02ee79fa6a
commit 3522ea73f9
2 changed files with 10 additions and 10 deletions

View File

@ -998,7 +998,7 @@ InsertFpdtRecord (
switch (PerfId) {
case MODULE_START_ID:
case MODULE_END_ID:
GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
StringPtr = ModuleName;
//
// Cache the offset of start image start record and use to update the start image end record if needed.
@ -1031,7 +1031,7 @@ InsertFpdtRecord (
case MODULE_LOADIMAGE_START_ID:
case MODULE_LOADIMAGE_END_ID:
GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
StringPtr = ModuleName;
if (PerfId == MODULE_LOADIMAGE_START_ID) {
mLoadImageCount ++;
@ -1071,7 +1071,7 @@ InsertFpdtRecord (
case MODULE_DB_SUPPORT_END_ID:
case MODULE_DB_STOP_START_ID:
case MODULE_DB_STOP_END_ID:
GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
StringPtr = ModuleName;
if (!PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) {
FpdtRecordPtr.GuidQwordEvent->Header.Type = FPDT_GUID_QWORD_EVENT_TYPE;
@ -1085,7 +1085,7 @@ InsertFpdtRecord (
break;
case MODULE_DB_END_ID:
GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
StringPtr = ModuleName;
if (!PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) {
FpdtRecordPtr.GuidQwordStringEvent->Header.Type = FPDT_GUID_QWORD_STRING_EVENT_TYPE;
@ -1131,7 +1131,7 @@ InsertFpdtRecord (
case PERF_INMODULE_END_ID:
case PERF_CROSSMODULE_START_ID:
case PERF_CROSSMODULE_END_ID:
GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
if (String != NULL) {
StringPtr = String;
} else {
@ -1153,7 +1153,7 @@ InsertFpdtRecord (
default:
if (Attribute != PerfEntry) {
GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
if (String != NULL) {
StringPtr = String;
} else {

View File

@ -587,7 +587,7 @@ InsertFpdtRecord (
switch (PerfId) {
case MODULE_START_ID:
case MODULE_END_ID:
GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
StringPtr = ModuleName;
//
// Cache the offset of start image start record and use to update the start image end record if needed.
@ -612,7 +612,7 @@ InsertFpdtRecord (
case MODULE_LOADIMAGE_START_ID:
case MODULE_LOADIMAGE_END_ID:
GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
StringPtr = ModuleName;
if (PerfId == MODULE_LOADIMAGE_START_ID) {
mLoadImageCount++;
@ -669,7 +669,7 @@ InsertFpdtRecord (
case PERF_INMODULE_END_ID:
case PERF_CROSSMODULE_START_ID:
case PERF_CROSSMODULE_END_ID:
GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
if (String != NULL) {
StringPtr = String;
} else {
@ -691,7 +691,7 @@ InsertFpdtRecord (
default:
if (Attribute != PerfEntry) {
GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
if (String != NULL) {
StringPtr = String;
} else {