From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys8u5-0007Qe-GH for qemu-devel@nongnu.org; Tue, 12 May 2015 08:03:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ys8u0-0003yp-Pw for qemu-devel@nongnu.org; Tue, 12 May 2015 08:03:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys8u0-0003ya-LU for qemu-devel@nongnu.org; Tue, 12 May 2015 08:03:12 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 44277A10A5 for ; Tue, 12 May 2015 12:03:12 +0000 (UTC) From: Markus Armbruster Date: Tue, 12 May 2015 14:02:57 +0200 Message-Id: <1431432187-10993-6-git-send-email-armbru@redhat.com> In-Reply-To: <1431432187-10993-1-git-send-email-armbru@redhat.com> References: <1431432187-10993-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 05/15] tap: net_tap_fd_init() can't fail, drop dead error handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: stefanha@redhat.com Signed-off-by: Markus Armbruster --- net/tap.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/net/tap.c b/net/tap.c index 8f06cb7..adb1022 100644 --- a/net/tap.c +++ b/net/tap.c @@ -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; @@ -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); @@ -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; } -- 1.9.3