Skip to content

Commit

Permalink
tap: net_tap_fd_init() can't fail, drop dead error handling
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1431691143-1015-6-git-send-email-armbru@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
Markus Armbruster authored and stefanhaRH committed May 27, 2015
1 parent 3791f83 commit da4a4ea
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions net/tap.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,6 @@ int net_init_bridge(const NetClientOptions *opts, const char *name,
/* FIXME error_setg(errp, ...) on failure */
const NetdevBridgeOptions *bridge;
const char *helper, *br;

TAPState *s;
int fd, vnet_hdr;

Expand All @@ -552,14 +551,8 @@ int net_init_bridge(const NetClientOptions *opts, const char *name,
}

fcntl(fd, F_SETFL, O_NONBLOCK);

vnet_hdr = tap_probe_vnet_hdr(fd);

s = net_tap_fd_init(peer, "bridge", name, fd, vnet_hdr);
if (!s) {
close(fd);
return -1;
}

snprintf(s->nc.info_str, sizeof(s->nc.info_str), "helper=%s,br=%s", helper,
br);
Expand Down Expand Up @@ -607,14 +600,9 @@ static int net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
int vnet_hdr, int fd)
{
Error *err = NULL;
TAPState *s;
TAPState *s = net_tap_fd_init(peer, model, name, fd, vnet_hdr);
int vhostfd;

s = net_tap_fd_init(peer, model, name, fd, vnet_hdr);
if (!s) {
return -1;
}

if (tap_set_sndbuf(s->fd, tap) < 0) {
return -1;
}
Expand Down

0 comments on commit da4a4ea

Please sign in to comment.