term/nns8250-spcr: return if redirection is disabled
PATCH 1/1 term/nns8250-spcr: return if redirection is disabled
From: Benjamin Herrenschmidt <[email protected]>
The Microsoft spec for SPCR says "The base address of the Serial Port register set described using the ACPI Generic Address Structure, or 0 if console redirection is disabled." so return if disable (base address = 0). If this check is not done, we may get invalid ports for those particular machines that redirection is disabled and at some point hanging the booting execution when reading the grub.cfg configuration file.
--- grub-core/term/ns8250-spcr.c | 5 +++++ 1 file changed, 5 insertions(+)
grub-core/term/ns8250-spcr.c +5 -0
@@ -76,6 +76,11 @@ grub_ns8250_spcr_init (void) config.speed =115200 ;break ; }; + +/* if base address is 0, it means redirection is disable, so return it */ +if (spcr->base_addr.addr ==0 ) +return NULL ; +switch (spcr->base_addr.space_id) {case GRUB_ACPI_GENADDR_MEM_SPACE :
Signature · 7 lines
2.47.0 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 11 lines · Leo Sandoval
From: Benjamin Herrenschmidt <[email protected]>
The Microsoft spec for SPCR says "The base address of the Serial Port register set described using the ACPI Generic Address Structure, or 0 if console redirection is disabled." so return if disable (base address = 0). If this check is not done, we may get invalid ports for those particular machines that redirection is disabled and at some point hanging the booting execution when reading the grub.cfg configuration file.
Signed-off-by Benjamin Herrenschmidt <[email protected]>Reviewed-by Leo Sandoval <[email protected]>
Daniel
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel