Skip to content

Commit

Permalink
stand/efi/eficom: Free comc_port if we can't find the serial port
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bsdimp committed May 24, 2023
1 parent af6cd8e commit 3206002
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions stand/efi/libefi/eficom.c
Expand Up @@ -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);
Expand Down

0 comments on commit 3206002

Please sign in to comment.