OvmfPkg: Fix the wild pointer in Fdt16550SerialProtHookLib

There was a wild pointer in Fdt16550SerialProtHookLib which pointed to
an unknown space, which was very wrong and has been fixed.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Chao Li <lichao@loongson.cn>
This commit is contained in:
Chao Li 2024-07-11 09:25:03 +08:00 committed by mergify[bot]
parent b92e16d5c3
commit 5dc6f19b38
1 changed files with 3 additions and 3 deletions

View File

@ -26,13 +26,13 @@ PlatformHookSerialPortInitialize (
VOID VOID
) )
{ {
UINT64 *UartBase; UINT64 UartBase;
if (PcdGet64 (PcdSerialRegisterBase) != 0) { if (PcdGet64 (PcdSerialRegisterBase) != 0) {
return RETURN_SUCCESS; return RETURN_SUCCESS;
} }
*UartBase = CsrRead (LOONGARCH_CSR_KS1); UartBase = CsrRead (LOONGARCH_CSR_KS1);
return (RETURN_STATUS)PcdSet64S (PcdSerialRegisterBase, (UINTN)*UartBase); return (RETURN_STATUS)PcdSet64S (PcdSerialRegisterBase, (UINTN)UartBase);
} }