mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
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>
This commit is contained in:
parent
2f859a3c10
commit
929fe49721
1 changed files with 3 additions and 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue