From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 431C3237 for ; Tue, 21 Nov 2017 14:21:31 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id EBEE120B0E; Tue, 21 Nov 2017 08:21:30 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:21:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=yWQgFriBvTgrg04aD mlWLXywMIueiJjhDYvPawPco8c=; b=aEI1qB7vBAhL5cW7gMbQYFMeZ9E4hrKv3 BYdGi2Vy7CLIXD2cAnPyt3u6eWA/B9rrt7zlwgq490TBUvaXH07yVTA6FOhTSuF6 DVDhQN+HVm/mh0ur7SIHeDRyAcSo9ttq/bqZ/1mCPP69iUiczu29roFWU7NWhZ2p KBYGpfjHdtDPFqrQARGDPGfcW03eB3+TWtWrWgKn+c4uvJRShzPNbS08EIa1CaR/ j2lZ/hCFShrCLF4wFHNSYc88Tl0/c57X5MisBQ9Sg95gBHybVh6VeXlWw7hrf6Kn sS000Fiz33715+vEDKvzSQGkTZJEA2dwuEZU8akxVHBrbAchWElCA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=yWQgFriBvTgrg04aDmlWLXywMIueiJjhDYvPawPco8c=; b=BUlyM02n 8g/01aqj6k4n8WB6E3RAl+PzRouPDRxAegefXeb00wrtMyUL1Upn5SglagMDap0H 27Emih8ChvHmSEozQdstdtelgZFbe4QmL9pYkxQWGiVdgKJQCsQhHNbk0e9z9e1H E764nklXCblzGw1r3sKJ24XqBX+2d2DotI8zpizbWxrzXO8mUe82s13q8OO8SEeu yRGExTcd58C2C64m7b8Bxx1kxUIsraL/jTGVpYH9aDnmOl8lhvovTXJB5wp1dWSO BY5N28twvl/sAfnZlds036bI1gXyWIre3N66YAybjj2L4d/bqQtawhGxdPFeDvPQ 6a3WZfVMbGQ5bw== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id DC11624631; Tue, 21 Nov 2017 08:21:27 -0500 (EST) From: Yuanhan Liu To: Jingjing Wu Cc: Beilei Xing , dpdk stable Date: Tue, 21 Nov 2017 21:16:15 +0800 Message-Id: <1511270333-31002-33-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> References: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/i40e: fix memory leak if VF init fails' has been queued to stable release 17.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 13:21:31 -0000 Hi, FYI, your patch has been queued to stable release 17.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 74716b1dd08278feda456e5f2aa1f7c70d66496f Mon Sep 17 00:00:00 2001 From: Jingjing Wu Date: Wed, 13 Sep 2017 07:54:23 +0800 Subject: [PATCH] net/i40e: fix memory leak if VF init fails [ upstream commit d031bff503bac11d8cefed90154441a4bc577d36 ] Fixes: 4861cde46116 ("i40e: new poll mode driver") Signed-off-by: Jingjing Wu Acked-by: Beilei Xing --- drivers/net/i40e/i40e_ethdev_vf.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 44fb0db..f6bd574 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1249,29 +1249,29 @@ i40evf_init_vf(struct rte_eth_dev *dev) /* VF reset, shutdown admin queue and initialize again */ if (i40e_shutdown_adminq(hw) != I40E_SUCCESS) { PMD_INIT_LOG(ERR, "i40e_shutdown_adminq failed"); - return -1; + goto err; } i40e_init_adminq_parameter(hw); if (i40e_init_adminq(hw) != I40E_SUCCESS) { PMD_INIT_LOG(ERR, "init_adminq failed"); - return -1; + goto err; } vf->aq_resp = rte_zmalloc("vf_aq_resp", I40E_AQ_BUF_SZ, 0); if (!vf->aq_resp) { PMD_INIT_LOG(ERR, "unable to allocate vf_aq_resp memory"); - goto err_aq; + goto err_aq; } if (i40evf_check_api_version(dev) != 0) { PMD_INIT_LOG(ERR, "check_api version failed"); - goto err_aq; + goto err_api; } bufsz = sizeof(struct virtchnl_vf_resource) + (I40E_MAX_VF_VSI * sizeof(struct virtchnl_vsi_resource)); vf->vf_res = rte_zmalloc("vf_res", bufsz, 0); if (!vf->vf_res) { PMD_INIT_LOG(ERR, "unable to allocate vf_res memory"); - goto err_aq; + goto err_api; } if (i40evf_get_vf_resource(dev) != 0) { @@ -1317,6 +1317,9 @@ i40evf_init_vf(struct rte_eth_dev *dev) err_alloc: rte_free(vf->vf_res); + vf->vsi_res = NULL; +err_api: + rte_free(vf->aq_resp); err_aq: i40e_shutdown_adminq(hw); /* ignore error */ err: -- 2.7.4