Skip to content

Commit

Permalink
term/ns8250: return in case of a null SPCR base addresses
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
lsandov1 committed Jan 14, 2025
1 parent df6160b commit d3e03cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions grub-core/term/ns8250.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit d3e03cc

Please sign in to comment.