[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] term/ns8250: return in case of a null SPCR base addresses
From: |
Leo Sandoval |
Subject: |
[PATCH] term/ns8250: return in case of a null SPCR base addresses |
Date: |
Thu, 9 Jan 2025 10:34:31 -0600 |
Serial SPCR MMIO null address are invalid, so return from function, otherwise
invalid 'mmio,0' port names are generated halting the system when running
terminal_input|output commands.
Signed-off-by: Leo Sandoval <lsandova@redhat.com>
---
grub-core/term/ns8250.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/grub-core/term/ns8250.c b/grub-core/term/ns8250.c
index 23e8e0904..4ac0bc06a 100644
--- a/grub-core/term/ns8250.c
+++ b/grub-core/term/ns8250.c
@@ -407,6 +407,9 @@ grub_serial_ns8250_add_mmio (grub_addr_t addr, unsigned int
acc_size,
struct grub_serial_port *p;
unsigned i;
+ if (addr == NULL)
+ return NULL;
+
for (i = 0; i < GRUB_SERIAL_PORT_NUM; i++)
if (com_ports[i].use_mmio == true && com_ports[i].mmio.base == addr)
{
--
2.47.0
- [PATCH] term/ns8250: return in case of a null SPCR base addresses,
Leo Sandoval <=