summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyve/pci_emul.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bhyve/pci_emul.c')
-rw-r--r--usr.sbin/bhyve/pci_emul.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c
index a30dde5..76e536c 100644
--- a/usr.sbin/bhyve/pci_emul.c
+++ b/usr.sbin/bhyve/pci_emul.c
@@ -140,20 +140,15 @@ pci_parse_slot(char *opt, int legacy)
error = -1;
str = cpy = strdup(opt);
- config = NULL;
-
- if (strchr(str, ':') != NULL) {
- slot = strsep(&str, ":");
- func = strsep(&str, ",");
- } else {
- slot = strsep(&str, ",");
- func = NULL;
- }
-
+ slot = strsep(&str, ",");
+ func = NULL;
+ if (strchr(slot, ':') != NULL) {
+ func = cpy;
+ (void) strsep(&func, ":");
+ }
+
emul = strsep(&str, ",");
- if (str != NULL) {
- config = strsep(&str, ",");
- }
+ config = str;
if (emul == NULL) {
pci_parse_slot_usage(opt);
OpenPOWER on IntegriCloud