Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/74596/?format=api
https://patches.dpdk.org/api/patches/74596/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1595390338-9588-1-git-send-email-wangyunjian@huawei.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": "<1595390338-9588-1-git-send-email-wangyunjian@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1595390338-9588-1-git-send-email-wangyunjian@huawei.com", "date": "2020-07-22T03:58:58", "name": "[v2] hash: fix return value of null not checked", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "0af58969bbcb469fcba385cb6ce0b87391f49894", "submitter": { "id": 551, "url": "https://patches.dpdk.org/api/people/551/?format=api", "name": "Yunjian Wang", "email": "wangyunjian@huawei.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/1595390338-9588-1-git-send-email-wangyunjian@huawei.com/mbox/", "series": [ { "id": 11224, "url": "https://patches.dpdk.org/api/series/11224/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11224", "date": "2020-07-22T03:58:58", "name": "[v2] hash: fix return value of null not checked", "version": 2, "mbox": "https://patches.dpdk.org/series/11224/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/74596/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/74596/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 93276A0526;\n\tWed, 22 Jul 2020 05:59:13 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 86E811BFD1;\n\tWed, 22 Jul 2020 05:59:12 +0200 (CEST)", "from huawei.com (szxga04-in.huawei.com [45.249.212.190])\n by dpdk.org (Postfix) with ESMTP id 243931BFBA;\n Wed, 22 Jul 2020 05:59:10 +0200 (CEST)", "from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59])\n by Forcepoint Email with ESMTP id E7BAD84E617C824CD05D;\n Wed, 22 Jul 2020 11:59:07 +0800 (CST)", "from localhost (10.174.185.168) by DGGEMS409-HUB.china.huawei.com\n (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Wed, 22 Jul 2020\n 11:59:00 +0800" ], "From": "wangyunjian <wangyunjian@huawei.com>", "To": "<dev@dpdk.org>", "CC": "<yipeng1.wang@intel.com>, <sameh.gobriel@intel.com>,\n <bruce.richardson@intel.com>, <jerry.lilijun@huawei.com>,\n <xudingke@huawei.com>, Yunjian Wang <wangyunjian@huawei.com>,\n <stable@dpdk.org>", "Date": "Wed, 22 Jul 2020 11:58:58 +0800", "Message-ID": "<1595390338-9588-1-git-send-email-wangyunjian@huawei.com>", "X-Mailer": "git-send-email 1.9.5.msysgit.1", "In-Reply-To": "\n <d87e2f714999b83c69685950d43a85350dc1441c.1595335031.git.wangyunjian@huawei.com>", "References": "\n <d87e2f714999b83c69685950d43a85350dc1441c.1595335031.git.wangyunjian@huawei.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.174.185.168]", "X-CFilter-Loop": "Reflected", "Subject": "[dpdk-dev] [PATCH v2] hash: fix return value of null not checked", "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": "From: Yunjian Wang <wangyunjian@huawei.com>\n\nThe function rte_zmalloc_socket() could return NULL, the return\nvalue need to be checked.\n\nFixes: 5915699153d7 (\"hash: fix scaling by reducing contention\")\nCc: stable@dpdk.org\n\nReported-by: Bin Huang <brian.huangbin@huawei.com>\nSigned-off-by: Yunjian Wang <wangyunjian@huawei.com>\nReviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\nAcked-by: Yipeng Wang <yipeng1.wang@intel.com>\n---\nv2:\n* Update commit log\n---\n lib/librte_hash/rte_cuckoo_hash.c | 9 ++++++++-\n 1 file changed, 8 insertions(+), 1 deletion(-)", "diff": "diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c\nindex 5f701d579..0a6d47471 100644\n--- a/lib/librte_hash/rte_cuckoo_hash.c\n+++ b/lib/librte_hash/rte_cuckoo_hash.c\n@@ -151,6 +151,7 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \tunsigned int no_free_on_del = 0;\n \tuint32_t *ext_bkt_to_free = NULL;\n \tuint32_t *tbl_chng_cnt = NULL;\n+\tstruct lcore_cache *local_free_slots = NULL;\n \tunsigned int readwrite_concur_lf_support = 0;\n \tuint32_t i;\n \n@@ -383,9 +384,13 @@ rte_hash_create(const struct rte_hash_parameters *params)\n #endif\n \n \tif (use_local_cache) {\n-\t\th->local_free_slots = rte_zmalloc_socket(NULL,\n+\t\tlocal_free_slots = rte_zmalloc_socket(NULL,\n \t\t\t\tsizeof(struct lcore_cache) * RTE_MAX_LCORE,\n \t\t\t\tRTE_CACHE_LINE_SIZE, params->socket_id);\n+\t\tif (local_free_slots == NULL) {\n+\t\t\tRTE_LOG(ERR, HASH, \"local free slots memory allocation failed\\n\");\n+\t\t\tgoto err_unlock;\n+\t\t}\n \t}\n \n \t/* Default hash function */\n@@ -416,6 +421,7 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \t*h->tbl_chng_cnt = 0;\n \th->hw_trans_mem_support = hw_trans_mem_support;\n \th->use_local_cache = use_local_cache;\n+\th->local_free_slots = local_free_slots;\n \th->readwrite_concur_support = readwrite_concur_support;\n \th->ext_table_support = ext_table_support;\n \th->writer_takes_lock = writer_takes_lock;\n@@ -461,6 +467,7 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \trte_ring_free(r);\n \trte_ring_free(r_ext);\n \trte_free(te);\n+\trte_free(local_free_slots);\n \trte_free(h);\n \trte_free(buckets);\n \trte_free(buckets_ext);\n", "prefixes": [ "v2" ] }{ "id": 74596, "url": "