Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/40736/?format=api
http://patchwork.dpdk.org/api/patches/40736/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20180607094322.14312-23-mk@semihalf.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": "<20180607094322.14312-23-mk@semihalf.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180607094322.14312-23-mk@semihalf.com", "date": "2018-06-07T09:43:18", "name": "[dpdk-dev,v3,23/27] net/ena: check pointer before memset", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "6e432d7272f4ca89e58301edb5c0f4e0df817bb8", "submitter": { "id": 786, "url": "http://patchwork.dpdk.org/api/people/786/?format=api", "name": "Michal Krawczyk", "email": "mk@semihalf.com" }, "delegate": { "id": 319, "url": "http://patchwork.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20180607094322.14312-23-mk@semihalf.com/mbox/", "series": [ { "id": 26, "url": "http://patchwork.dpdk.org/api/series/26/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=26", "date": "2018-06-07T09:43:00", "name": "net/ena: new features and fixes", "version": 3, "mbox": "http://patchwork.dpdk.org/series/26/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/40736/comments/", "check": "fail", "checks": "http://patchwork.dpdk.org/api/patches/40736/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 EAEB41B623;\n\tThu, 7 Jun 2018 11:44:18 +0200 (CEST)", "from mail-lf0-f50.google.com (mail-lf0-f50.google.com\n\t[209.85.215.50]) by dpdk.org (Postfix) with ESMTP id DD3281B3F0\n\tfor <dev@dpdk.org>; Thu, 7 Jun 2018 11:44:17 +0200 (CEST)", "by mail-lf0-f50.google.com with SMTP id i83-v6so13657396lfh.5\n\tfor <dev@dpdk.org>; Thu, 07 Jun 2018 02:44:17 -0700 (PDT)", "from mkPC.semihalf.local (31-172-191-173.noc.fibertech.net.pl.\n\t[31.172.191.173]) by smtp.gmail.com with ESMTPSA id\n\tp28-v6sm3612368lfh.24.2018.06.07.02.44.14\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 07 Jun 2018 02:44:15 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=semihalf-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=SAtXlHMV0FBsEo0Xi1UinCpHnc+YFrmUOsBuiGZuUnk=;\n\tb=yrb5W1cvmt2ABxEC7hgN76KSqofkncY8NNqpo+ZI60YRXHLhQn2ZZVeBCedfpDLIUY\n\t0gCgsTUfPcneGblrKfj0SUT3BESRlF0PQnGATRzdARmJJ1hnJ3Lz7J6HRG+ocfngNgiT\n\tGk1Y9mPkFkYVv3ZPZXGJNrKAe+Aa/Ti1lHZU92sBwxFCBTfS3v47MBMNfczqTw5kBAja\n\tpc7cUAxGkOR/TNCAARvDV36xrg04x8HFt98mLOpmGQfmgddRTz6v6hHeXXjBYMfiUIlt\n\tocynAbG0kz6g73j/jq2PUCNZSfP5qazfzbnJYnCIExO7hXy2tnSniHrmJr8ct72mnOMo\n\tKjww==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=SAtXlHMV0FBsEo0Xi1UinCpHnc+YFrmUOsBuiGZuUnk=;\n\tb=TqncqVdbeYVUWqhyrNwylv9iotV51UWEItkxgu3/4DUPwRoH0yJPTbjMPi9FYB6qDk\n\t0MK109wD+AaAw4rF5W5ft1SJt+1Q/XTVs+pQgvjoJhrRKLsChBUTba2MQRLIxLwfv38D\n\t1FQIfqrhwXrMaID7QvoW8RyPk7lP6gVJoEC1QmrR6uuk1Tc5GlLSaJLNJong1xSqevUh\n\t69iZ+mwq+03R0wepACjJVlyZJEV5I3EQZXaSgoS0ffN7Bvr15Hj6VdnV86tZoRe3FHaI\n\tuKrFwsQiYwhFG9MF5MFMSgMEimfy/8rCvAvizlQLW2vt6fc2lKOmQwKeLO54fD9YjoEz\n\tXWcg==", "X-Gm-Message-State": "APt69E17vP7rWEspWQQ9mbVN7TUfDP+8OLo5P8DNY4ie2Mt+jN290hP5\n\trig9gGFjoHb26KyYQYxSKgeFtQ==", "X-Google-Smtp-Source": "ADUXVKJXpsBLszHnd5HZgBQJnTkT37Jz4bscldVBGZQ1oDuJaGaSj0kU4U3KkcrebibtKcrd4gFHYQ==", "X-Received": "by 2002:a19:c1c1:: with SMTP id\n\tr184-v6mr875168lff.51.1528364657566; \n\tThu, 07 Jun 2018 02:44:17 -0700 (PDT)", "From": "Michal Krawczyk <mk@semihalf.com>", "To": "Marcin Wojtas <mw@semihalf.com>, Michal Krawczyk <mk@semihalf.com>,\n\tGuy Tzalik <gtzalik@amazon.com>, Evgeny Schemeilin <evgenys@amazon.com>", "Cc": "dev@dpdk.org,\n\tmatua@amazon.com,\n\tRafal Kozik <rk@semihalf.com>", "Date": "Thu, 7 Jun 2018 11:43:18 +0200", "Message-Id": "<20180607094322.14312-23-mk@semihalf.com>", "X-Mailer": "git-send-email 2.14.1", "In-Reply-To": "<20180607094322.14312-1-mk@semihalf.com>", "References": "<20180607094322.14312-1-mk@semihalf.com>", "Subject": "[dpdk-dev] [PATCH v3 23/27] net/ena: check pointer before memset", "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://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": "<https://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": "From: Rafal Kozik <rk@semihalf.com>\n\nNeed to check if memory allocation succeed before using it.\nUsing memset on NULL pointer cause segfault.\n\nFixes: 9ba7981ec992 (\"ena: add communication layer for DPDK\")\n\nSigned-off-by: Rafal Kozik <rk@semihalf.com>\nAcked-by: Michal Krawczyk <mk@semihalf.com>\n---\n drivers/net/ena/base/ena_plat_dpdk.h | 22 ++++++++++++++++------\n 1 file changed, 16 insertions(+), 6 deletions(-)", "diff": "diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h\nindex e2af4ee2c..d30153e92 100644\n--- a/drivers/net/ena/base/ena_plat_dpdk.h\n+++ b/drivers/net/ena/base/ena_plat_dpdk.h\n@@ -210,10 +210,15 @@ extern uint32_t ena_alloc_cnt;\n \t\t\t\t\"ena_alloc_%d\", ena_alloc_cnt++);\t\\\n \t\tmz = rte_memzone_reserve(z_name, size, SOCKET_ID_ANY,\t\\\n \t\t\t\tRTE_MEMZONE_IOVA_CONTIG);\t\t\\\n-\t\tmemset(mz->addr, 0, size);\t\t\t\t\\\n-\t\tvirt = mz->addr;\t\t\t\t\t\\\n-\t\tphys = mz->iova;\t\t\t\t\t\\\n \t\thandle = mz;\t\t\t\t\t\t\\\n+\t\tif (mz == NULL) {\t\t\t\t\t\\\n+\t\t\tvirt = NULL;\t\t\t\t\t\\\n+\t\t\tphys = 0;\t\t\t\t\t\\\n+\t\t} else {\t\t\t\t\t\t\\\n+\t\t\tmemset(mz->addr, 0, size);\t\t\t\\\n+\t\t\tvirt = mz->addr;\t\t\t\t\\\n+\t\t\tphys = mz->iova;\t\t\t\t\\\n+\t\t}\t\t\t\t\t\t\t\\\n \t} while (0)\n #define ENA_MEM_FREE_COHERENT(dmadev, size, virt, phys, handle) \t\\\n \t\t({ ENA_TOUCH(size); ENA_TOUCH(phys);\t\t\t\\\n@@ -230,9 +235,14 @@ extern uint32_t ena_alloc_cnt;\n \t\t\t\t\"ena_alloc_%d\", ena_alloc_cnt++);\t\\\n \t\tmz = rte_memzone_reserve(z_name, size, node,\t\t\\\n \t\t\t\tRTE_MEMZONE_IOVA_CONTIG);\t\t\\\n-\t\tmemset(mz->addr, 0, size);\t\t\t\t\\\n-\t\tvirt = mz->addr;\t\t\t\t\t\\\n-\t\tphys = mz->iova;\t\t\t\t\t\\\n+\t\tif (mz == NULL) {\t\t\t\t\t\\\n+\t\t\tvirt = NULL;\t\t\t\t\t\\\n+\t\t\tphys = 0;\t\t\t\t\t\\\n+\t\t} else {\t\t\t\t\t\t\\\n+\t\t\tmemset(mz->addr, 0, size);\t\t\t\\\n+\t\t\tvirt = mz->addr;\t\t\t\t\\\n+\t\t\tphys = mz->iova;\t\t\t\t\\\n+\t\t}\t\t\t\t\t\t\t\\\n \t\t(void)mem_handle;\t\t\t\t\t\\\n \t} while (0)\n \n", "prefixes": [ "dpdk-dev", "v3", "23/27" ] }{ "id": 40736, "url": "