Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167949520
D40220.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D40220.diff
View Options
diff --git a/stand/efi/libefi/eficom.c b/stand/efi/libefi/eficom.c
--- a/stand/efi/libefi/eficom.c
+++ b/stand/efi/libefi/eficom.c
@@ -332,9 +332,12 @@
env_setenv("efi_com_speed", EV_VOLATILE, value,
comc_speed_set, env_nounset);
- eficom.c_flags = 0;
if (comc_setup()) {
sc->c_flags = C_PRESENTIN | C_PRESENTOUT;
+ } else {
+ sc->c_flags &= ~(C_PRESENTIN | C_PRESENTOUT);
+ free(comc_port);
+ comc_port = NULL;
}
}
@@ -349,14 +352,20 @@
}
#endif
+/*
+ * Called when the console is selected in cons_change. If we didn't detect the
+ * device, comc_port will be NULL, and comc_setup will fail. It may be called
+ * even when the device isn't present as a 'fallback' console or when listed
+ * specifically in console env, so we have to reset the c_flags in those case to
+ * say it's not present.
+ */
static int
comc_init(int arg __unused)
{
-
if (comc_setup())
return (CMD_OK);
- eficom.c_flags = 0;
+ eficom.c_flags &= ~(C_ACTIVEIN | C_ACTIVEOUT);
return (CMD_ERROR);
}
@@ -516,8 +525,10 @@
EFI_STATUS status;
char *ev;
- /* port is not usable */
- if (comc_port->sio == NULL)
+ /*
+ * If the device isn't active, or there's no port present.
+ */
+ if ((eficom.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) == 0 || comc_port == NULL)
return (false);
if (comc_port->sio->Reset != NULL) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 26, 2:17 PM (3 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37302827
Default Alt Text
D40220.diff (1 KB)
Attached To
Mode
D40220: stand/efi/eficom: better handling of absent device
Attached
Detach File
Event Timeline
Log In to Comment