]> xenbits.xensource.com Git - ovmf.git/commitdiff
ArmVirtPkg: Fix parsing of serial port node
authorSami Mujawar <sami.mujawar@arm.com>
Mon, 12 Dec 2022 10:40:52 +0000 (10:40 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 29 Mar 2023 13:48:54 +0000 (13:48 +0000)
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>
ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.c

index fb1daf32769c20521e93de7af0f54a6a8e2c8369..c1b81920214b16137fd7c40b8ec897031e6fe9aa 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Early Platform Hook Library instance for 16550 Uart.\r
 \r
-  Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>\r
+  Copyright (c) 2020 - 2023, Arm Ltd. All rights reserved.<BR>\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -67,7 +67,7 @@ GetSerialConsolePortAddress (
   }\r
 \r
   // Determine the actual path length, as a colon terminates the path.\r
-  Path = ScanMem8 (Prop, ':', PropSize);\r
+  Path = ScanMem8 (Prop, PropSize, ':');\r
   if (Path == NULL) {\r
     PathLen = AsciiStrLen (Prop);\r
   } else {\r