Message ID | 20180723201748.25573-47-mdroth@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DDF7791E for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 23 Jul 2018 20:59:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCA7A27FA1 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 23 Jul 2018 20:59:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C070B28387; Mon, 23 Jul 2018 20:59:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 494D627FA1 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 23 Jul 2018 20:59:00 +0000 (UTC) Received: from localhost ([::1]:36574 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1fhhv1-0002Zy-FX for patchwork-qemu-devel@patchwork.kernel.org; Mon, 23 Jul 2018 16:58:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <flukshun@gmail.com>) id 1fhhJS-0002d7-J9 for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:20:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <flukshun@gmail.com>) id 1fhhJR-0004Q9-5K for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:20:10 -0400 Received: from mail-oi0-x232.google.com ([2607:f8b0:4003:c06::232]:43123) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <flukshun@gmail.com>) id 1fhhJQ-0004Pl-VJ; Mon, 23 Jul 2018 16:20:09 -0400 Received: by mail-oi0-x232.google.com with SMTP id b15-v6so3463936oib.10; Mon, 23 Jul 2018 13:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=tsbcI48Kf1Rydg5LkaqGpCpV2o8JVbjZE0kuCXx4IIs=; b=HM4+p+/6HHbajWWtalla/fr2EwQC2dKbhUb+tQVNLXIeyjRYv83GWg+PPfARcMRolm Meg/xKmivoYcUs3ZnJUAHv3nLIcvhZD6BnTT02VP7EaTAgV0WdlZzdnS24IoHS9BiJUi EtOkcT5cbcD9OnWq05KeLvaA+FQARN81zHAC0ODoXoavfJpEP8JiBtbSJAzySjt7WEtn f6ct6269CEP5L4DFF1R9G2FD+ZZDnSI5gUW5k77WHb44nf5ONgalwRgU7Sx+f1SPUi4e Em38sqCbDXWkiE36lw0hTlOWk1pbkN6wNEaaM3UdIfC1jIZovNA0LRY9fMp3Xpd50k4r vCAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=tsbcI48Kf1Rydg5LkaqGpCpV2o8JVbjZE0kuCXx4IIs=; b=d4Fg8qtWSiD2iv7hyrnlaVtQEickyXnhMp6K9n08r8/xrf9SuFV8Tuj5feEurOln7A g7DOtESOwMyyjNClgqzA/hj4x5lofdT4L6DwRtoiaYKDvsXQYUjIrEBf48T17HWDMdQ4 CneXzUN+KmIoux9PBn65hn5mMu81Dr8yfbCCV+ynlEJAyoYUanieIRzDtzCObcEh4yW/ ZJsbnLTBnQXdUIgQhRUGIt24PzrRPVeMh3x9bTT4Q5dDjrilu1ObAJ8m1eMKEdfx0hZc bKAY2UK8tbbJYNKNvfwBpzR1PAHoPjFp7jOHl+gmO6U2GeEzfAGYn99zuLu87foPtu8P xmFg== X-Gm-Message-State: AOUpUlGvzl/bIDREi40I2ZO0MWo+T7hyo7du1FmUBiPEd+NNCSdeMPB8 o/eOffqI2gXVqNmOvo61r00NLpC+nO4= X-Google-Smtp-Source: AAOMgpdi5OkNDvs1NRD1PjRmVMzNKy3lWdJ4HUWWNxg6Tzy6qxqmMbpW7qCGpM0+E+Vbz0Lld+FytQ== X-Received: by 2002:aca:7517:: with SMTP id q23-v6mr280391oic.352.1532377207836; Mon, 23 Jul 2018 13:20:07 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id q124-v6sm7912273oif.8.2018.07.23.13.20.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 13:20:06 -0700 (PDT) From: Michael Roth <mdroth@linux.vnet.ibm.com> To: qemu-devel@nongnu.org Date: Mon, 23 Jul 2018 15:16:55 -0500 Message-Id: <20180723201748.25573-47-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> References: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::232 Subject: [Qemu-devel] [PATCH 46/99] vhost-user: delete net client if necessary X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: linzhecheng <linzhecheng@huawei.com>, Jason Wang <jasowang@redhat.com>, qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Patch Round-up for stable 2.12.1, freeze on 2018-07-30
|
expand
|
diff --git a/net/vhost-user.c b/net/vhost-user.c index e0f16c895b..62745c06dd 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -299,7 +299,7 @@ static int net_vhost_user_init(NetClientState *peer, const char *device, s = DO_UPCAST(VhostUserState, nc, nc); if (!qemu_chr_fe_init(&s->chr, chr, &err)) { error_report_err(err); - return -1; + goto err; } } @@ -309,7 +309,7 @@ static int net_vhost_user_init(NetClientState *peer, const char *device, do { if (qemu_chr_fe_wait_connected(&s->chr, &err) < 0) { error_report_err(err); - return -1; + goto err; } qemu_chr_fe_set_handlers(&s->chr, NULL, NULL, net_vhost_user_event, NULL, nc0->name, NULL, @@ -319,6 +319,13 @@ static int net_vhost_user_init(NetClientState *peer, const char *device, assert(s->vhost_net); return 0; + +err: + if (nc0) { + qemu_del_net_client(nc0); + } + + return -1; } static Chardev *net_vhost_claim_chardev(