MdeModulePkg/ReportStatusCodeRouter: Update RSC Data on reallocation

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2670

The RSC router data buffer may be reallocated when the buffer is nearing
exhaustion (7/8 portion of the buffer used).

While several pointers are updated to point to the newly allocated buffer,
the RscData is not updated. This commit updates the RSC data pointer
to the same offset in the reallocated data buffer.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Kun Qin <Kun.Qin@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
This commit is contained in:
Michael Kubacki 2020-04-09 08:04:47 +08:00 committed by mergify[bot]
parent 05db94018b
commit 0f127f3187
1 changed files with 1 additions and 0 deletions

View File

@ -290,6 +290,7 @@ ReportDispatcher (
if (NewBuffer != NULL) {
FailSafeEndPointer = (EFI_PHYSICAL_ADDRESS) (UINTN) NewBuffer + (FailSafeEndPointer - CallbackEntry->StatusCodeDataBuffer);
CallbackEntry->EndPointer = (EFI_PHYSICAL_ADDRESS) (UINTN) NewBuffer + (CallbackEntry->EndPointer - CallbackEntry->StatusCodeDataBuffer);
RscData = (RSC_DATA_ENTRY *) (UINTN) ((UINTN) NewBuffer + ((UINTN) RscData - CallbackEntry->StatusCodeDataBuffer));
CallbackEntry->StatusCodeDataBuffer = (EFI_PHYSICAL_ADDRESS) (UINTN) NewBuffer;
CallbackEntry->BufferSize *= 2;
}