From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtEGl-0000kM-Nk for qemu-devel@nongnu.org; Fri, 15 May 2015 07:59:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtEGi-0006yT-RH for qemu-devel@nongnu.org; Fri, 15 May 2015 07:59:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtEGi-0006y7-Jc for qemu-devel@nongnu.org; Fri, 15 May 2015 07:59:08 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4FBx7Kx025850 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 15 May 2015 07:59:08 -0400 From: Markus Armbruster Date: Fri, 15 May 2015 13:58:53 +0200 Message-Id: <1431691143-1015-6-git-send-email-armbru@redhat.com> In-Reply-To: <1431691143-1015-1-git-send-email-armbru@redhat.com> References: <1431691143-1015-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH v2 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: eblake@redhat.co, stefanha@redhat.com Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- 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