Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/62883/?format=api
http://patches.dpdk.org/api/patches/62883/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191112035011.67537-5-shougangx.wang@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": "<20191112035011.67537-5-shougangx.wang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20191112035011.67537-5-shougangx.wang@intel.com", "date": "2019-11-12T03:50:11", "name": "[v4,4/4] net/ice: fix wild pointer", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "6641d596bbe929a8cd31a6d374464a2a41439919", "submitter": { "id": 1418, "url": "http://patches.dpdk.org/api/people/1418/?format=api", "name": "Shougang Wang", "email": "shougangx.wang@intel.com" }, "delegate": { "id": 31221, "url": "http://patches.dpdk.org/api/users/31221/?format=api", "username": "yexl", "first_name": "xiaolong", "last_name": "ye", "email": "xiaolong.ye@intel.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20191112035011.67537-5-shougangx.wang@intel.com/mbox/", "series": [ { "id": 7409, "url": "http://patches.dpdk.org/api/series/7409/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7409", "date": "2019-11-12T03:50:07", "name": "net/ice: fix memory release in FDIR", "version": 4, "mbox": "http://patches.dpdk.org/series/7409/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/62883/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/62883/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 3195CA04AB;\n\tTue, 12 Nov 2019 11:09:44 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A770D2C12;\n\tTue, 12 Nov 2019 11:09:26 +0100 (CET)", "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by dpdk.org (Postfix) with ESMTP id 294062BEA\n for <dev@dpdk.org>; Tue, 12 Nov 2019 11:09:23 +0100 (CET)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 12 Nov 2019 02:09:22 -0800", "from intel.sh.intel.com ([10.239.255.146])\n by fmsmga001.fm.intel.com with ESMTP; 12 Nov 2019 02:09:21 -0800" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.68,295,1569308400\"; d=\"scan'208\";a=\"214048348\"", "From": "Wang ShougangX <shougangx.wang@intel.com>", "To": "dev@dpdk.org", "Cc": "qiming.yang@intel.com, qi.z.zhang@intel.com,\n Wang ShougangX <shougangx.wang@intel.com>", "Date": "Tue, 12 Nov 2019 03:50:11 +0000", "Message-Id": "<20191112035011.67537-5-shougangx.wang@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20191112035011.67537-1-shougangx.wang@intel.com>", "References": "<20191105033806.2878-1-shougangx.wang@intel.com>\n <20191112035011.67537-1-shougangx.wang@intel.com>", "Subject": "[dpdk-dev] [PATCH v4 4/4] net/ice: fix wild pointer", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "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", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "To avoid wild pointer, pointers should be set to NULL after free them.\n\nFixes: 1a2fc1799f09 (\"net/ice: reject duplicated flow for flow director\")\nFixes: 84dc7a95a2d3 (\"net/ice: enable flow director engine\")\nFixes: 0f880c3df192 (\"net/ice: add flow director counter resource init/release\")\n\nSigned-off-by: Wang ShougangX <shougangx.wang@intel.com>\n---\n drivers/net/ice/ice_fdir_filter.c | 19 ++++++++++++++++---\n 1 file changed, 16 insertions(+), 3 deletions(-)", "diff": "diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c\nindex 82dd283f7..ac03819ed 100644\n--- a/drivers/net/ice/ice_fdir_filter.c\n+++ b/drivers/net/ice/ice_fdir_filter.c\n@@ -152,6 +152,7 @@ ice_fdir_prof_alloc(struct ice_hw *hw)\n \t\tif (!hw->fdir_prof)\n \t\t\treturn -ENOMEM;\n \t}\n+\n \tfor (ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP;\n \t ptype < ICE_FLTR_PTYPE_MAX;\n \t ptype++) {\n@@ -167,9 +168,13 @@ ice_fdir_prof_alloc(struct ice_hw *hw)\n fail_mem:\n \tfor (fltr_ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP;\n \t fltr_ptype < ptype;\n-\t fltr_ptype++)\n+\t fltr_ptype++) {\n \t\trte_free(hw->fdir_prof[fltr_ptype]);\n+\t\thw->fdir_prof[fltr_ptype] = NULL;\n+\t}\n+\n \trte_free(hw->fdir_prof);\n+\thw->fdir_prof = NULL;\n \treturn -ENOMEM;\n }\n \n@@ -249,8 +254,10 @@ ice_fdir_counter_release(struct ice_pf *pf)\n \t\t\t\t&fdir_info->counter;\n \tuint8_t i;\n \n-\tfor (i = 0; i < container->index_free; i++)\n+\tfor (i = 0; i < container->index_free; i++) {\n \t\trte_free(container->pools[i]);\n+\t\tcontainer->pools[i] = NULL;\n+\t}\n \n \tTAILQ_INIT(&container->pool_list);\n \tcontainer->index_free = 0;\n@@ -400,6 +407,9 @@ ice_fdir_release_filter_list(struct ice_pf *pf)\n \t\trte_free(fdir_info->hash_map);\n \tif (fdir_info->hash_table)\n \t\trte_hash_free(fdir_info->hash_table);\n+\n+\tfdir_info->hash_map = NULL;\n+\tfdir_info->hash_table = NULL;\n }\n \n /*\n@@ -526,10 +536,13 @@ ice_fdir_prof_free(struct ice_hw *hw)\n \n \tfor (ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP;\n \t ptype < ICE_FLTR_PTYPE_MAX;\n-\t ptype++)\n+\t ptype++) {\n \t\trte_free(hw->fdir_prof[ptype]);\n+\t\thw->fdir_prof[ptype] = NULL;\n+\t}\n \n \trte_free(hw->fdir_prof);\n+\thw->fdir_prof = NULL;\n }\n \n /* Remove a profile for some filter type */\n", "prefixes": [ "v4", "4/4" ] }{ "id": 62883, "url": "