summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Mujawar <sami.mujawar@arm.com>2022-12-12 10:40:52 +0000
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-03-29 13:48:54 +0000
commit47b1d6116982c9e1e75c3f1bf9014fce7e2b0f9c (patch)
tree93dbc23a5a81a09c32708c98c5cf99faeaf515b4
parentcc6a0cff99503f5bda5d14a20e98f29e8780a3c0 (diff)
downloadedk2-47b1d6116982c9e1e75c3f1bf9014fce7e2b0f9c.tar.gz
edk2-47b1d6116982c9e1e75c3f1bf9014fce7e2b0f9c.tar.bz2
edk2-47b1d6116982c9e1e75c3f1bf9014fce7e2b0f9c.zip
ArmVirtPkg: Fix parsing of serial port node
When scanning for the Serial Port in the device tree, the length and value parameters to ScanMem8() are not in the right order. This results in the serial port not being detected if the chosen node in the device tree has additional elements. Therefore, pass the parameters to ScanMem8() in the correct order to fix this issue. Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
-rw-r--r--ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.c b/ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.c
index fb1daf3276..c1b8192021 100644
--- a/ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.c
+++ b/ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.c
@@ -1,7 +1,7 @@
/** @file
Early Platform Hook Library instance for 16550 Uart.
- Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>
+ Copyright (c) 2020 - 2023, Arm Ltd. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -67,7 +67,7 @@ GetSerialConsolePortAddress (
}
// Determine the actual path length, as a colon terminates the path.
- Path = ScanMem8 (Prop, ':', PropSize);
+ Path = ScanMem8 (Prop, PropSize, ':');
if (Path == NULL) {
PathLen = AsciiStrLen (Prop);
} else {