Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/134095/?format=api
http://patchwork.dpdk.org/api/patches/134095/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20231110100117.8350-2-fengchengwen@huawei.com/", "project": { "id": 1, "url": "http://patchwork.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": "<20231110100117.8350-2-fengchengwen@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20231110100117.8350-2-fengchengwen@huawei.com", "date": "2023-11-10T10:01:02", "name": "[v2,01/16] eal: verify strdup return value", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "7f252dbd6b8e16b6463d58628451238c63f1956a", "submitter": { "id": 2146, "url": "http://patchwork.dpdk.org/api/people/2146/?format=api", "name": "fengchengwen", "email": "fengchengwen@huawei.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20231110100117.8350-2-fengchengwen@huawei.com/mbox/", "series": [ { "id": 30243, "url": "http://patchwork.dpdk.org/api/series/30243/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=30243", "date": "2023-11-10T10:01:03", "name": "verify strdup return value", "version": 2, "mbox": "http://patchwork.dpdk.org/series/30243/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/134095/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/134095/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 7D4FA432F3;\n\tFri, 10 Nov 2023 11:05:00 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BB89B42E3F;\n\tFri, 10 Nov 2023 11:04:14 +0100 (CET)", "from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188])\n by mails.dpdk.org (Postfix) with ESMTP id BAE4040268\n for <dev@dpdk.org>; Fri, 10 Nov 2023 11:04:04 +0100 (CET)", "from dggpeml100024.china.huawei.com (unknown [172.30.72.56])\n by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SRZCj24nxzWhJR;\n Fri, 10 Nov 2023 18:03:45 +0800 (CST)", "from localhost.localdomain (10.50.165.33) by\n dggpeml100024.china.huawei.com (7.185.36.115) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2507.31; Fri, 10 Nov 2023 18:04:00 +0800" ], "From": "Chengwen Feng <fengchengwen@huawei.com>", "To": "<thomas@monjalon.net>, <ferruh.yigit@amd.com>, Keith Wiles\n <keith.wiles@intel.com>, Ciara Power <ciara.power@intel.com>, Bruce\n Richardson <bruce.richardson@intel.com>, Jeff Guo <jia.guo@intel.com>,\n Jianfeng Tan <jianfeng.tan@intel.com>", "CC": "<dev@dpdk.org>", "Subject": "[PATCH v2 01/16] eal: verify strdup return value", "Date": "Fri, 10 Nov 2023 10:01:02 +0000", "Message-ID": "<20231110100117.8350-2-fengchengwen@huawei.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20231110100117.8350-1-fengchengwen@huawei.com>", "References": "<20231110100117.8350-1-fengchengwen@huawei.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.50.165.33]", "X-ClientProxiedBy": "dggems703-chm.china.huawei.com (10.3.19.180) To\n dggpeml100024.china.huawei.com (7.185.36.115)", "X-CFilter-Loop": "Reflected", "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": "Add verify strdup() return value logic.\n\nFixes: 293c53d8b23c (\"eal: add telemetry callbacks\")\nFixes: 0d0f478d0483 (\"eal/linux: add uevent parse and process\")\nCc: stable@dpdk.org\n\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\n---\n lib/eal/common/eal_common_options.c | 24 ++++++++++++++++++++++--\n lib/eal/linux/eal_dev.c | 3 +++\n 2 files changed, 25 insertions(+), 2 deletions(-)", "diff": "diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c\nindex a6d21f1cba..8b5a4632dd 100644\n--- a/lib/eal/common/eal_common_options.c\n+++ b/lib/eal/common/eal_common_options.c\n@@ -226,6 +226,8 @@ eal_save_args(int argc, char **argv)\n \t\tif (strcmp(argv[i], \"--\") == 0)\n \t\t\tbreak;\n \t\teal_args[i] = strdup(argv[i]);\n+\t\tif (eal_args[i] == NULL)\n+\t\t\tgoto error;\n \t}\n \teal_args[i++] = NULL; /* always finish with NULL */\n \n@@ -235,13 +237,31 @@ eal_save_args(int argc, char **argv)\n \n \teal_app_args = calloc(argc - i + 1, sizeof(*eal_args));\n \tif (eal_app_args == NULL)\n-\t\treturn -1;\n+\t\tgoto error;\n \n-\tfor (j = 0; i < argc; j++, i++)\n+\tfor (j = 0; i < argc; j++, i++) {\n \t\teal_app_args[j] = strdup(argv[i]);\n+\t\tif (eal_app_args[j] == NULL)\n+\t\t\tgoto error;\n+\t}\n \teal_app_args[j] = NULL;\n \n \treturn 0;\n+\n+error:\n+\tif (eal_app_args != NULL) {\n+\t\ti = 0;\n+\t\twhile (eal_app_args[i] != NULL)\n+\t\t\tfree(eal_app_args[i++]);\n+\t\tfree(eal_app_args);\n+\t\teal_app_args = NULL;\n+\t}\n+\ti = 0;\n+\twhile (eal_args[i] != NULL)\n+\t\tfree(eal_args[i++]);\n+\tfree(eal_args);\n+\teal_args = NULL;\n+\treturn -1;\n }\n #endif\n \ndiff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c\nindex ac76f6174d..df3cd6b39a 100644\n--- a/lib/eal/linux/eal_dev.c\n+++ b/lib/eal/linux/eal_dev.c\n@@ -181,7 +181,10 @@ dev_uev_parse(const char *buf, struct rte_dev_event *event, int length)\n \t\t\tbuf += 14;\n \t\t\ti += 14;\n \t\t\tstrlcpy(pci_slot_name, buf, sizeof(subsystem));\n+\t\t\tfree(event->devname);\n \t\t\tevent->devname = strdup(pci_slot_name);\n+\t\t\tif (event->devname == NULL)\n+\t\t\t\treturn -1;\n \t\t}\n \t\tfor (; i < length; i++) {\n \t\t\tif (*buf == '\\0')\n", "prefixes": [ "v2", "01/16" ] }{ "id": 134095, "url": "