Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/28646/?format=api
http://patches.dpdk.org/api/patches/28646/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1505260463-56186-1-git-send-email-jingjing.wu@intel.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1505260463-56186-1-git-send-email-jingjing.wu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1505260463-56186-1-git-send-email-jingjing.wu@intel.com", "date": "2017-09-12T23:54:23", "name": "[dpdk-dev,v3] net/i40e: fix memory leak if VF init fails", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "e8330d1cab475a56dcfac839acd711b0fcff2cae", "submitter": { "id": 47, "url": "http://patches.dpdk.org/api/people/47/?format=api", "name": "Jingjing Wu", "email": "jingjing.wu@intel.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1505260463-56186-1-git-send-email-jingjing.wu@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/28646/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/28646/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id CA2DA7D4E;\n\tWed, 13 Sep 2017 09:12:05 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 58B66374E;\n\tWed, 13 Sep 2017 09:12:03 +0200 (CEST)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Sep 2017 00:12:02 -0700", "from dpdk11.sh.intel.com ([10.67.110.198])\n\tby fmsmga002.fm.intel.com with ESMTP; 13 Sep 2017 00:12:00 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos; i=\"5.42,386,1500966000\"; d=\"scan'208\";\n\ta=\"1218139292\"", "From": "Jingjing Wu <jingjing.wu@intel.com>", "To": "beilei.xing@intel.com", "Cc": "dev@dpdk.org,\n\tjingjing.wu@intel.com,\n\tstable@dpdk.org", "Date": "Wed, 13 Sep 2017 07:54:23 +0800", "Message-Id": "<1505260463-56186-1-git-send-email-jingjing.wu@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1505244231-51364-1-git-send-email-jingjing.wu@intel.com>", "References": "<1505244231-51364-1-git-send-email-jingjing.wu@intel.com>", "Subject": "[dpdk-dev] [PATCH v3] net/i40e: fix memory leak if VF init fails", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Cc: stable@dpdk.org\nFixes: 4861cde46116 (\"i40e: new poll mode driver\")\n\nSigned-off-by: Jingjing Wu <jingjing.wu@intel.com>\n---\nv3 change:\n - add new err branch to free aq_resp\n - fix indent\n\nv2 change:\n - free aq_resp at err_aq\n\n\n drivers/net/i40e/i40e_ethdev_vf.c | 13 ++++++++-----\n 1 file changed, 8 insertions(+), 5 deletions(-)", "diff": "diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c\nindex f6d8293..44806d1 100644\n--- a/drivers/net/i40e/i40e_ethdev_vf.c\n+++ b/drivers/net/i40e/i40e_ethdev_vf.c\n@@ -1249,29 +1249,29 @@ i40evf_init_vf(struct rte_eth_dev *dev)\n \t/* VF reset, shutdown admin queue and initialize again */\n \tif (i40e_shutdown_adminq(hw) != I40E_SUCCESS) {\n \t\tPMD_INIT_LOG(ERR, \"i40e_shutdown_adminq failed\");\n-\t\treturn -1;\n+\t\tgoto err;\n \t}\n \n \ti40e_init_adminq_parameter(hw);\n \tif (i40e_init_adminq(hw) != I40E_SUCCESS) {\n \t\tPMD_INIT_LOG(ERR, \"init_adminq failed\");\n-\t\treturn -1;\n+\t\tgoto err;\n \t}\n \tvf->aq_resp = rte_zmalloc(\"vf_aq_resp\", I40E_AQ_BUF_SZ, 0);\n \tif (!vf->aq_resp) {\n \t\tPMD_INIT_LOG(ERR, \"unable to allocate vf_aq_resp memory\");\n-\t\t\tgoto err_aq;\n+\t\tgoto err_aq;\n \t}\n \tif (i40evf_check_api_version(dev) != 0) {\n \t\tPMD_INIT_LOG(ERR, \"check_api version failed\");\n-\t\tgoto err_aq;\n+\t\tgoto err_api;\n \t}\n \tbufsz = sizeof(struct virtchnl_vf_resource) +\n \t\t(I40E_MAX_VF_VSI * sizeof(struct virtchnl_vsi_resource));\n \tvf->vf_res = rte_zmalloc(\"vf_res\", bufsz, 0);\n \tif (!vf->vf_res) {\n \t\tPMD_INIT_LOG(ERR, \"unable to allocate vf_res memory\");\n-\t\t\tgoto err_aq;\n+\t\tgoto err_api;\n \t}\n \n \tif (i40evf_get_vf_resource(dev) != 0) {\n@@ -1317,6 +1317,9 @@ i40evf_init_vf(struct rte_eth_dev *dev)\n \n err_alloc:\n \trte_free(vf->vf_res);\n+\tvf->vsi_res = NULL;\n+err_api:\n+\trte_free(vf->aq_resp);\n err_aq:\n \ti40e_shutdown_adminq(hw); /* ignore error */\n err:\n", "prefixes": [ "dpdk-dev", "v3" ] }{ "id": 28646, "url": "