From 5dc6f19b384abe761429d3192ab76c213b57b211 Mon Sep 17 00:00:00 2001 From: Chao Li Date: Thu, 11 Jul 2024 09:25:03 +0800 Subject: 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 Cc: Jiewen Yao Cc: Gerd Hoffmann Signed-off-by: Chao Li --- .../Library/Fdt16550SerialPortHookLib/Fdt16550SerialPortHookLib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OvmfPkg/LoongArchVirt') diff --git a/OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/Fdt16550SerialPortHookLib.c b/OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/Fdt16550SerialPortHookLib.c index baaa7ae7a9..8a73b8f9b3 100644 --- a/OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/Fdt16550SerialPortHookLib.c +++ b/OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/Fdt16550SerialPortHookLib.c @@ -26,13 +26,13 @@ PlatformHookSerialPortInitialize ( VOID ) { - UINT64 *UartBase; + UINT64 UartBase; if (PcdGet64 (PcdSerialRegisterBase) != 0) { 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); } -- cgit