From da3e039a0533122113f26db830bfc39f41d2bfd3 Mon Sep 17 00:00:00 2001 From: Aiken Harris Date: Sun, 20 Jul 2025 14:53:04 +0200 Subject: [PATCH] Use correct address when clearing COM port buffer The code was reading from Port->Address to clear the RBR before the field was initialized. --- xtoskrnl/hl/cport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xtoskrnl/hl/cport.c b/xtoskrnl/hl/cport.c index 09f3129..d370a81 100644 --- a/xtoskrnl/hl/cport.c +++ b/xtoskrnl/hl/cport.c @@ -277,7 +277,7 @@ HlInitializeComPort(IN OUT PCPPORT Port, HlIoPortOutByte(PtrToUshort(PortAddress + (ULONG)COMPORT_REG_MCR), COMPORT_MCR_NOM); /* Read junk data out of the Receive Buffer Register (RBR) */ - HlIoPortInByte(PtrToUshort(Port->Address + (ULONG)COMPORT_REG_RBR)); + HlIoPortInByte(PtrToUshort(PortAddress + (ULONG)COMPORT_REG_RBR)); /* Store port details */ Port->Address = PortAddress;