Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/108043/?format=api
https://patches.dpdk.org/api/patches/108043/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/tencent_1F9863BA78C24FBB225C757ABE1F47F84509@qq.com/", "project": { "id": 1, "url": "https://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": "<tencent_1F9863BA78C24FBB225C757ABE1F47F84509@qq.com>", "list_archive_url": "https://inbox.dpdk.org/dev/tencent_1F9863BA78C24FBB225C757ABE1F47F84509@qq.com", "date": "2022-02-22T18:18:11", "name": "[13/20] net/ice: fix memory leaks in error handlings", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "cc5c3c461352a1004e58a31c19c6f11ba8e11868", "submitter": { "id": 2458, "url": "https://patches.dpdk.org/api/people/2458/?format=api", "name": "Weiguo Li", "email": "liwg06@foxmail.com" }, "delegate": { "id": 24651, "url": "https://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/tencent_1F9863BA78C24FBB225C757ABE1F47F84509@qq.com/mbox/", "series": [ { "id": 21799, "url": "https://patches.dpdk.org/api/series/21799/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=21799", "date": "2022-02-22T18:17:58", "name": "fix memory leaks in error handling", "version": 1, "mbox": "https://patches.dpdk.org/series/21799/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/108043/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/108043/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id BF781A034E;\n\tTue, 22 Feb 2022 19:19:55 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 672D9411EE;\n\tTue, 22 Feb 2022 19:19:20 +0100 (CET)", "from out203-205-251-72.mail.qq.com (out203-205-251-72.mail.qq.com\n [203.205.251.72])\n by mails.dpdk.org (Postfix) with ESMTP id E656C40DF6\n for <dev@dpdk.org>; Tue, 22 Feb 2022 19:19:17 +0100 (CET)", "from localhost.localdomain ([111.193.130.237])\n by newxmesmtplogicsvrszc6.qq.com (NewEsmtp) with SMTP\n id 49223207; Wed, 23 Feb 2022 02:18:18 +0800" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com;\n s=s201512; t=1645553954;\n bh=ZH6CClkNDEQtuN85rKnNN4HUnBHfNN194X9JjalKC8Y=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References;\n b=nPc6bntAjbmiFdZhzNqcRipg9SzF6fJzkAEChnQP9eDgn3KiggorB1sqoq3J3+hsK\n bMmPOATlp21y0GBh01oTaRpiEaw66vIAkOES1fgHvt+gsJ3nEI25gN7wXyElfeWvm7\n HD9UA3oI/S4g4bWd9A3SlhwofHgKwbQ+GTPweuys=", "X-QQ-mid": "xmsmtpt1645553950t64c654so", "Message-ID": "<tencent_1F9863BA78C24FBB225C757ABE1F47F84509@qq.com>", "X-QQ-XMAILINFO": "M3vv73qU6a4ul8qWHlI6vJ3ARnhbWKAR/fRfFBij+WoB0K8N3kN4tcUFyp6RKM\n CT2hbHwohlcxdbqHPaNBot+yTbPuonUeoyt6w4J+4uGAXOXgDK+wE2l57UG9/aXjrywtUpea4CCW\n lnRDE8xPvdNaaFQXFPXNsY2SZfY47Mh5L3WE5hNrVFfHTm10asYTLvqhP0JnbMA+cL1B0cnFLtPr\n 6bqJm45cfWHOwMPs2n29RjBXKUkVoooUo0vnyIfFizOx5CsK+jOfXyqO9osPFldcqZZvlZmkA20m\n QAt2zFOuUvHSx7vwe/vMXI+p+G7Zothha57+p36PTqoXID9Bqbvntm+qyVfQzOSSKCUjxJjIx6I0\n 6OxU4kmJEX9xMqZOJwVN17aNZ48ug0iDF9dO6EUVtvA18g81tqYGYoFibDfxevE6a7IFfSNVvWRL\n xRYt6nKOYI9IZdBdmV6omTyXvX/FIdyztafNuWeEBCTQWcpdjFHZlYHH6f/CdfgR//ObdzkzpcND\n axuxKInfPT5j9oCaL+blyhzxKyKFPocouLAEQS9nHnrwADHDHU6MorH1mpN7f4Dbc08CAenPxzZd\n ZQBlWYvMJSWztD8fxszKsmR2uXg2ETA1/pcq4Oblxt/CA6r2sgQpTqh9qYYtBufps+vPBcDzugrw\n iAV9zV2Vf1X6iiPjnlzIBZLdI2kzYBsbKGg439ehbrpBIFCRMJfxSj4AXVmFdMv79f28lRqAKilj\n K1p8Hy8176esvjDxTs5fUoys6AH4eqspEm1SS1V8DyqomPWE2NqsA8sZ46Un8u+/1qoCZdg5ubhP\n cLr/wrAoDOr5dgYpDspLrHsjHyub0Zj9lyM7/xtVLoKQGsdapL1aCNcDC8vZ6Xo5KuwyYa0+Ueig\n ==", "From": "Weiguo Li <liwg06@foxmail.com>", "To": "dev@dpdk.org", "Cc": "adypodoman@gmail.com, xiaoyun.li@intel.com, tianfei.zhang@intel.com,\n bruce.richardson@intel.com, ivan.malov@oktetlabs.ru, jgrajcia@cisco.com,\n hkalra@marvell.com, ying.a.wang@intel.com, ting.xu@intel.com,\n simei.su@intel.com, qiming.yang@intel.com, motih@mellanox.com,\n shreyansh.jain@nxp.com, skoteshwar@marvell.com, stephen@networkplumber.org,\n kalesh-anakkur.purayil@broadcom.com, somnath.kotur@broadcom.com,\n declan.doherty@intel.com, gakhil@marvell.com, nicolas.chautru@intel.com", "Subject": "[PATCH 13/20] net/ice: fix memory leaks in error handlings", "Date": "Wed, 23 Feb 2022 02:18:11 +0800", "X-OQ-MSGID": "\n <27cce613aeff899ff9b9df646a185faf901f9073.1645551559.git.liwg06@foxmail.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<cover.1645551559.git.liwg06@foxmail.com>", "References": "<cover.1645551559.git.liwg06@foxmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "The function release 'pkt_buf' and 'msk_buf' when successful. In some\nerror handlings, 'pkt_buf' and 'msk_buf' were not freed leads to memory\nleaks.\nTo fix it without introducing code redundancy, add and make use of an\n'error' lable to do the clean ups for 'pkt_buf' and 'msk_buf'.\n\nFixes: 1b9c68120a1c50 (\"net/ice: enable protocol agnostic flow offloading in RSS\")\n\nSigned-off-by: Weiguo Li <liwg06@foxmail.com>\n---\n drivers/net/ice/ice_hash.c | 30 +++++++++++++++++++-----------\n 1 file changed, 19 insertions(+), 11 deletions(-)", "diff": "diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c\nindex afbb357fa3..aed256d57c 100644\n--- a/drivers/net/ice/ice_hash.c\n+++ b/drivers/net/ice/ice_hash.c\n@@ -658,7 +658,7 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad,\n \tuint8_t spec_len, pkt_len;\n \tuint8_t tmp_val = 0;\n \tuint8_t tmp_c = 0;\n-\tint i, j;\n+\tint i, j, ret = 0;\n \n \traw_spec = item->spec;\n \traw_mask = item->mask;\n@@ -675,9 +675,10 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad,\n \t\treturn -ENOMEM;\n \n \tmsk_buf = rte_zmalloc(NULL, pkt_len, 0);\n-\tif (!msk_buf)\n-\t\treturn -ENOMEM;\n-\n+\tif (!msk_buf) {\n+\t\tret = -ENOMEM;\n+\t\tgoto exit;\n+\t}\n \t/* convert string to int array */\n \tfor (i = 0, j = 0; i < spec_len; i += 2, j++) {\n \t\ttmp_c = raw_spec->pattern[i];\n@@ -713,21 +714,28 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad,\n \t\t\tmsk_buf[j] = tmp_val * 16 + tmp_c - '0';\n \t}\n \n-\tif (ice_parser_create(&ad->hw, &psr))\n-\t\treturn -rte_errno;\n-\tif (ice_parser_run(psr, pkt_buf, pkt_len, &rslt))\n-\t\treturn -rte_errno;\n+\tif (ice_parser_create(&ad->hw, &psr)) {\n+\t\tret = -rte_errno;\n+\t\tgoto exit;\n+\t}\n+\tif (ice_parser_run(psr, pkt_buf, pkt_len, &rslt)) {\n+\t\tret = -rte_errno;\n+\t\tgoto exit;\n+\t}\n \tice_parser_destroy(psr);\n \n \tif (ice_parser_profile_init(&rslt, pkt_buf, msk_buf,\n-\t\tpkt_len, ICE_BLK_RSS, true, &prof))\n-\t\treturn -rte_errno;\n+\t\tpkt_len, ICE_BLK_RSS, true, &prof)) {\n+\t\tret = -rte_errno;\n+\t\tgoto exit;\n+\t}\n \n \trte_memcpy(&meta->raw.prof, &prof, sizeof(prof));\n \n+exit:\n \trte_free(pkt_buf);\n \trte_free(msk_buf);\n-\treturn 0;\n+\treturn ret;\n }\n \n static void\n", "prefixes": [ "13/20" ] }{ "id": 108043, "url": "