Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/28709/?format=api
http://patches.dpdk.org/api/patches/28709/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1505372353-24159-1-git-send-email-wang.yong19@zte.com.cn/", "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": "<1505372353-24159-1-git-send-email-wang.yong19@zte.com.cn>", "list_archive_url": "https://inbox.dpdk.org/dev/1505372353-24159-1-git-send-email-wang.yong19@zte.com.cn", "date": "2017-09-14T06:59:13", "name": "[dpdk-dev] net/ark:add null point check", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "baf95b765f2da252f4a6033892eab6c0374df58b", "submitter": { "id": 609, "url": "http://patches.dpdk.org/api/people/609/?format=api", "name": "Yong Wang", "email": "wang.yong19@zte.com.cn" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1505372353-24159-1-git-send-email-wang.yong19@zte.com.cn/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/28709/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/28709/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2726A7D4E;\n\tThu, 14 Sep 2017 09:12:34 +0200 (CEST)", "from mxhk.zte.com.cn (mxhk.zte.com.cn [63.217.80.70])\n\tby dpdk.org (Postfix) with ESMTP id 414607CCD\n\tfor <dev@dpdk.org>; Thu, 14 Sep 2017 09:12:32 +0200 (CEST)", "from mse01.zte.com.cn (unknown [10.30.3.20])\n\tby Forcepoint Email with ESMTPS id 29756AA819A84FF01C33;\n\tThu, 14 Sep 2017 15:12:31 +0800 (CST)", "from notes_smtp.zte.com.cn ([10.30.1.239])\n\tby mse01.zte.com.cn with ESMTP id v8E7COIh092173;\n\tThu, 14 Sep 2017 15:12:24 +0800 (GMT-8)\n\t(envelope-from wang.yong19@zte.com.cn)", "from localhost.localdomain.localdomain ([10.43.166.165])\n\tby szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6)\n\twith ESMTP id 2017091415122839-2463745 ;\n\tThu, 14 Sep 2017 15:12:28 +0800 " ], "From": "Yong Wang <wang.yong19@zte.com.cn>", "To": "shepard.siegel@atomicrules.com", "Cc": "dev@dpdk.org, Yong Wang <wang.yong19@zte.com.cn>", "Date": "Thu, 14 Sep 2017 02:59:13 -0400", "Message-Id": "<1505372353-24159-1-git-send-email-wang.yong19@zte.com.cn>", "X-Mailer": "git-send-email 1.8.3.1", "X-MIMETrack": "Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release\n\t8.5.3FP6|November 21, 2013) at 2017-09-14 15:12:28,\n\tSerialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17,\n\t2016) at\n\t2017-09-14 15:12:11, Serialize complete at 2017-09-14 15:12:11", "X-MAIL": "mse01.zte.com.cn v8E7COIh092173", "Subject": "[dpdk-dev] [PATCH] net/ark:add null point check", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "In function ark_config_device(), there are several malloc without null\npoint check. Fix it by adding null point check.\n\nSigned-off-by: Yong Wang <wang.yong19@zte.com.cn>\n---\n drivers/net/ark/ark_ethdev.c | 6 ++++++\n drivers/net/ark/ark_pktchkr.c | 4 ++++\n drivers/net/ark/ark_pktdir.c | 4 ++++\n drivers/net/ark/ark_pktgen.c | 4 ++++\n 4 files changed, 18 insertions(+)", "diff": "diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c\nindex 6db362b..f5a834a 100644\n--- a/drivers/net/ark/ark_ethdev.c\n+++ b/drivers/net/ark/ark_ethdev.c\n@@ -452,10 +452,16 @@ static void eth_ark_macaddr_remove(struct rte_eth_dev *dev,\n \t */\n \tark->start_pg = 0;\n \tark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);\n+\tif (ark->pg == NULL)\n+\t\treturn -1;\n \tark_pktgen_reset(ark->pg);\n \tark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1);\n+\tif (ark->pc == NULL)\n+\t\treturn -1;\n \tark_pktchkr_stop(ark->pc);\n \tark->pd = ark_pktdir_init(ark->pktdir.v);\n+\tif (ark->pd == NULL)\n+\t\treturn -1;\n \n \t/* Verify HW */\n \tif (ark_udm_verify(ark->udm.v))\ndiff --git a/drivers/net/ark/ark_pktchkr.c b/drivers/net/ark/ark_pktchkr.c\nindex c3040af..0bc8ae9 100644\n--- a/drivers/net/ark/ark_pktchkr.c\n+++ b/drivers/net/ark/ark_pktchkr.c\n@@ -112,6 +112,10 @@ struct OPTIONS {\n \tstruct ark_pkt_chkr_inst *inst =\n \t\trte_malloc(\"ark_pkt_chkr_inst\",\n \t\t\t sizeof(struct ark_pkt_chkr_inst), 0);\n+\tif (inst == NULL) {\n+ PMD_DRV_LOG(ERR, \"Failed to malloc ark_pkt_chkr_inst.\\n\");\n+ return inst;\n+ }\n \tinst->sregs = (struct ark_pkt_chkr_stat_regs *)addr;\n \tinst->cregs =\n \t\t(struct ark_pkt_chkr_ctl_regs *)(((uint8_t *)addr) + 0x100);\ndiff --git a/drivers/net/ark/ark_pktdir.c b/drivers/net/ark/ark_pktdir.c\nindex 66e5ce2..e524fbe 100644\n--- a/drivers/net/ark/ark_pktdir.c\n+++ b/drivers/net/ark/ark_pktdir.c\n@@ -45,6 +45,10 @@\n \t\trte_malloc(\"ark_pkt_dir_inst\",\n \t\t\t sizeof(struct ark_pkt_dir_inst),\n \t\t\t 0);\n+\tif (inst == NULL) {\n+ PMD_DRV_LOG(ERR, \"Failed to malloc ark_pkt_dir_inst.\\n\");\n+ return inst;\n+ }\n \tinst->regs = (struct ark_pkt_dir_regs *)base;\n \tinst->regs->ctrl = 0x00110110;\t/* POR state */\n \treturn inst;\ndiff --git a/drivers/net/ark/ark_pktgen.c b/drivers/net/ark/ark_pktgen.c\nindex 8c7a8a2..018f37b 100644\n--- a/drivers/net/ark/ark_pktgen.c\n+++ b/drivers/net/ark/ark_pktgen.c\n@@ -110,6 +110,10 @@ struct OPTIONS {\n \tstruct ark_pkt_gen_inst *inst =\n \t\trte_malloc(\"ark_pkt_gen_inst_pmd\",\n \t\t\t sizeof(struct ark_pkt_gen_inst), 0);\n+\tif (inst == NULL) {\n+\t\tPMD_DRV_LOG(ERR, \"Failed to malloc ark_pkt_gen_inst.\\n\");\n+\t\treturn inst;\n+\t}\n \tinst->regs = (struct ark_pkt_gen_regs *)adr;\n \tinst->ordinal = ord;\n \tinst->l2_mode = l2_mode;\n", "prefixes": [ "dpdk-dev" ] }{ "id": 28709, "url": "