diff options
author | Juergen Lock <nox@jelal.kn-bremen.de> | 2009-11-20 23:23:03 +0100 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2009-11-21 09:32:15 +0000 |
commit | 929fe497219cdf0f060f430a59062bd44b30ec8a (patch) | |
tree | 6261ae48a2f613d12042d9e311d0629338021a1a /net/tap.c | |
parent | 2f859a3c10c8a038661592fcdfe003ec97cca938 (diff) | |
download | qemu-929fe497219cdf0f060f430a59062bd44b30ec8a.tar.gz qemu-929fe497219cdf0f060f430a59062bd44b30ec8a.tar.bz2 qemu-929fe497219cdf0f060f430a59062bd44b30ec8a.zip |
Avoid segfault on net_tap_init() failure
Check for fd == -1 there.
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'net/tap.c')
-rw-r--r-- | net/tap.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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); |