stand/efi/eficom: Free comc_port if we can't find the serial port

If we can't find the serial port, free comc_port and return early. The
serial port just isn't there.

Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D40223
This commit is contained in:
Warner Losh 2023-05-24 16:34:51 -06:00
parent e5d4e036f2
commit 46927f6744

View file

@ -329,6 +329,16 @@ comc_probe(struct console *sc)
}
}
/*
* If there's no sio, then the device isn't there, so just return since
* the present flags aren't yet set.
*/
if (comc_port->sio == NULL) {
free(comc_port);
comc_port = NULL;
return;
}
if (env != NULL)
unsetenv("efi_com_port");
snprintf(value, sizeof (value), "%u", comc_port->ioaddr);