[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/3] Avoid segfault on net_tap_init() failure
From: |
Juergen Lock |
Subject: |
[Qemu-devel] [PATCH 2/3] Avoid segfault on net_tap_init() failure |
Date: |
Fri, 20 Nov 2009 23:23:03 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Check for fd == -1 there.
Signed-off-by: Juergen Lock <address@hidden>
--- a/net/tap.c
+++ b/net/tap.c
@@ -400,6 +400,9 @@ int net_init_tap(QemuOpts *opts, Monitor
}
fd = net_tap_init(opts, &vnet_hdr);
+ if (fd == -1) {
+ return -1;
+ }
}
s = net_tap_fd_init(vlan, "tap", name, fd, vnet_hdr);