summaryrefslogtreecommitdiffstats
path: root/OvmfPkg
diff options
context:
space:
mode:
authorChao Li <lichao@loongson.cn>2024-07-11 09:25:03 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-07-12 10:11:17 +0000
commit5dc6f19b384abe761429d3192ab76c213b57b211 (patch)
tree1b17384cfad3a1200bbb415d4ab6b88a46e2b79e /OvmfPkg
parentb92e16d5c30d3a525721720691035cf149a48f74 (diff)
downloadedk2-5dc6f19b384abe761429d3192ab76c213b57b211.tar.gz
edk2-5dc6f19b384abe761429d3192ab76c213b57b211.tar.bz2
edk2-5dc6f19b384abe761429d3192ab76c213b57b211.zip
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>
Diffstat (limited to 'OvmfPkg')
-rw-r--r--OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/Fdt16550SerialPortHookLib.c6
1 files changed, 3 insertions, 3 deletions
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);
}