Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/125211/?format=api
https://patches.dpdk.org/api/patches/125211/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230316212904.9318-4-syalavarthi@marvell.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": "<20230316212904.9318-4-syalavarthi@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230316212904.9318-4-syalavarthi@marvell.com", "date": "2023-03-16T21:28:59", "name": "[v3,3/8] ml/cnxk: add pointer check after memory allocation", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "5d48bf79743ced16c9670e8f71e9318779666daa", "submitter": { "id": 2480, "url": "https://patches.dpdk.org/api/people/2480/?format=api", "name": "Srikanth Yalavarthi", "email": "syalavarthi@marvell.com" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230316212904.9318-4-syalavarthi@marvell.com/mbox/", "series": [ { "id": 27429, "url": "https://patches.dpdk.org/api/series/27429/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=27429", "date": "2023-03-16T21:28:56", "name": "Fixes to ml/cnxk driver", "version": 3, "mbox": "https://patches.dpdk.org/series/27429/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/125211/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/125211/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 53E8041EB5;\n\tThu, 16 Mar 2023 22:29:44 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B3E6942DBF;\n\tThu, 16 Mar 2023 22:29:41 +0100 (CET)", "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id 6869A42DB3\n for <dev@dpdk.org>; Thu, 16 Mar 2023 22:29:38 +0100 (CET)", "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 32GG041Q005830 for <dev@dpdk.org>; Thu, 16 Mar 2023 14:29:37 -0700", "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3pbxq2ucrj-2\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Thu, 16 Mar 2023 14:29:37 -0700", "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42;\n Thu, 16 Mar 2023 14:29:35 -0700", "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend\n Transport; Thu, 16 Mar 2023 14:29:35 -0700", "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id 9DE4C3F707D;\n Thu, 16 Mar 2023 14:29:35 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-type; s=pfpt0220; bh=i5GgR1NxcfTPqcvHkYHk403KelJJB7nucMeiJ3TfF18=;\n b=KV9ePjwVSZ6IxPuj7ERzb/QWbSNpU0Cul6XYCxk1hdKQJw2tqJY4zJOaCp3cfTLyHBWQ\n n7m6uHJ4n48rsidq9etRFjrpN4YroxHlSxC1UtSHAUk8iDZyulkwwWk1Bi8Y5wQF94cX\n gA26jhHcBGDnQIVo57K6QrUOYk6lTtiYW4as9TLFTAD6ybq6nyBhgzLYKPjYpvFKwFhg\n 0YSRz4eprqbGEoAwT/IY71WJv/1e8kOZY+KdYH8/QyO/gDeAeN8H/pdjI3EtBlS0dR/d\n anGFuy0DZXhEwJrEhEuW3uEu8li40OP7dcHARS28NBV7bPWnVoOw2WjoYE5LC0rJuW5o pQ==", "From": "Srikanth Yalavarthi <syalavarthi@marvell.com>", "To": "Srikanth Yalavarthi <syalavarthi@marvell.com>, Prince Takkar\n <ptakkar@marvell.com>, Shivah Shankar S <sshankarnara@marvell.com>", "CC": "<dev@dpdk.org>, <aprabhu@marvell.com>, <pshukla@marvell.com>", "Subject": "[PATCH v3 3/8] ml/cnxk: add pointer check after memory allocation", "Date": "Thu, 16 Mar 2023 14:28:59 -0700", "Message-ID": "<20230316212904.9318-4-syalavarthi@marvell.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20230316212904.9318-1-syalavarthi@marvell.com>", "References": "<20230315135427.11489-1-syalavarthi@marvell.com>\n <20230316212904.9318-1-syalavarthi@marvell.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Proofpoint-GUID": "iCB_PgqwvHHqg4uH-MxA-jYkZd6jzpP5", "X-Proofpoint-ORIG-GUID": "iCB_PgqwvHHqg4uH-MxA-jYkZd6jzpP5", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22\n definitions=2023-03-16_14,2023-03-16_02,2023-02-09_01", "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": "Added checks for null pointers after memory allocation. Issues\nwere reported by klocwork static analysis tool.\n\nFixes: 515e3608c741 (\"ml/cnxk: configure OCM page size\")\nFixes: 4ff4ab8e1a20 (\"ml/cnxk: support extended statistics\")\n\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\n---\n drivers/ml/cnxk/cn10k_ml_ocm.c | 10 +++++++++-\n drivers/ml/cnxk/cn10k_ml_ops.c | 10 ++++++++++\n 2 files changed, 19 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/ml/cnxk/cn10k_ml_ocm.c b/drivers/ml/cnxk/cn10k_ml_ocm.c\nindex 1ea45b5b60..b9211b50a8 100644\n--- a/drivers/ml/cnxk/cn10k_ml_ocm.c\n+++ b/drivers/ml/cnxk/cn10k_ml_ocm.c\n@@ -268,8 +268,12 @@ cn10k_ml_ocm_tilemask_find(struct rte_ml_dev *dev, uint8_t num_tiles, uint16_t w\n \t\tsearch_end_tile = start_tile;\n \t}\n \n-\t/* nibbles + prefix '0x' */\n+\t/* allocate for local ocm mask */\n \tlocal_ocm_mask = rte_zmalloc(\"local_ocm_mask\", mldev->ocm.mask_words, RTE_CACHE_LINE_SIZE);\n+\tif (local_ocm_mask == NULL) {\n+\t\tplt_err(\"Unable to allocate memory for local_ocm_mask\");\n+\t\treturn -1;\n+\t}\n \n \ttile_start = search_start_tile;\n start_search:\n@@ -494,6 +498,10 @@ cn10k_ml_ocm_print(struct rte_ml_dev *dev, FILE *fp)\n \n \t/* nibbles + prefix '0x' */\n \tstr = rte_zmalloc(\"ocm_mask_str\", mldev->ocm.num_pages / 4 + 2, RTE_CACHE_LINE_SIZE);\n+\tif (str == NULL) {\n+\t\tplt_err(\"Unable to allocate memory for ocm_mask_str\");\n+\t\treturn;\n+\t}\n \n \tfprintf(fp, \"OCM State:\\n\");\n \tfor (tile_id = 0; tile_id < ocm->num_tiles; tile_id++) {\ndiff --git a/drivers/ml/cnxk/cn10k_ml_ops.c b/drivers/ml/cnxk/cn10k_ml_ops.c\nindex bf9409ad10..8d31276e8c 100644\n--- a/drivers/ml/cnxk/cn10k_ml_ops.c\n+++ b/drivers/ml/cnxk/cn10k_ml_ops.c\n@@ -789,6 +789,11 @@ cn10k_ml_dev_configure(struct rte_ml_dev *dev, const struct rte_ml_dev_config *c\n \t/* Allocate memory for ocm_mask */\n \tocm->ocm_mask =\n \t\trte_zmalloc(\"ocm_mask\", ocm->mask_words * ocm->num_tiles, RTE_CACHE_LINE_SIZE);\n+\tif (ocm->ocm_mask == NULL) {\n+\t\tplt_err(\"Unable to allocate memory for OCM mask\");\n+\t\tret = -ENOMEM;\n+\t\tgoto error;\n+\t}\n \n \tfor (tile_id = 0; tile_id < ocm->num_tiles; tile_id++) {\n \t\tocm->tile_ocm_info[tile_id].ocm_mask = ocm->ocm_mask + tile_id * ocm->mask_words;\n@@ -1107,6 +1112,11 @@ cn10k_ml_dev_xstats_by_name_get(struct rte_ml_dev *dev, const char *name, uint16\n \tnum_xstats = PLT_DIM(cn10k_ml_model_xstats_table) * mldev->nb_models_loaded;\n \txstats_map = rte_zmalloc(\"cn10k_ml_xstats_map\",\n \t\t\t\t sizeof(struct rte_ml_dev_xstats_map) * num_xstats, 0);\n+\tif (xstats_map == NULL) {\n+\t\tplt_err(\"Unable to allocate memory for cn10k_ml_xstats_map\");\n+\t\treturn -ENOMEM;\n+\t}\n+\n \tcn10k_ml_dev_xstats_names_get(dev, xstats_map, num_xstats);\n \n \tcn10k_ml_dev_info_get(dev, &dev_info);\n", "prefixes": [ "v3", "3/8" ] }{ "id": 125211, "url": "