mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
bhyve: avoid an empty passthru config value
pci_parse_legacy_config splits the options string by comma characters. strchr returns a pointer to the first occurence of a character. In that case, it's a comma. So, pci_parse_legacy_config will stop at the first character and creates a new config node with a name of NULL. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D34600
This commit is contained in:
parent
8ac8adda8d
commit
3256b7ca36
1 changed files with 6 additions and 1 deletions
|
|
@ -662,7 +662,12 @@ passthru_legacy_config(nvlist_t *nvl, const char *opts)
|
|||
snprintf(value, sizeof(value), "%d", func);
|
||||
set_config_value_node(nvl, "func", value);
|
||||
|
||||
return (pci_parse_legacy_config(nvl, strchr(opts, ',')));
|
||||
opts = strchr(opts, ',');
|
||||
if (opts == NULL) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
return pci_parse_legacy_config(nvl, opts + 1);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Reference in a new issue