term/ns8250: return in case of a null SPCR base addresses
PATCH 1/1 term/ns8250: return in case of a null SPCR base addresses
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.
--- grub-core/term/ns8250.c | 3 +++ 1 file changed, 3 insertions(+)
grub-core/term/ns8250.c +3 -0
@@ -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) {
Signature · 7 lines
2.47.0 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
Please ignore this patch, a better approach is
https://lists.gnu.org/archive/html/grub-devel/2025-01/msg00093.html
Quoted 25 lines · Leo Sandoval
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]>--- grub-core/term/ns8250.c | 3 +++ 1 file changed, 3 insertions(+)grub-core/term/ns8250.c +3
-0@@ -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){
Quoted 9 lines
--
2.47.0_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel