aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/tap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/tap.c b/net/tap.c
index 69c905cdc1..b2e5908c35 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -399,6 +399,9 @@ int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan
}
fd = net_tap_init(opts, &vnet_hdr);
+ if (fd == -1) {
+ return -1;
+ }
}
s = net_tap_fd_init(vlan, "tap", name, fd, vnet_hdr);