get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/44511/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 44511,
    "url": "https://patches.dpdk.org/api/patches/44511/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1536587210-35122-1-git-send-email-ziye.yang@intel.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": "<1536587210-35122-1-git-send-email-ziye.yang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1536587210-35122-1-git-send-email-ziye.yang@intel.com",
    "date": "2018-09-10T13:46:50",
    "name": "[v6] linuxapp, eal: Fix the memory leak issue of logid",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4c4a8bfdb6443ad39b23b9419860896a7064f3dc",
    "submitter": {
        "id": 407,
        "url": "https://patches.dpdk.org/api/people/407/?format=api",
        "name": "Ziye Yang",
        "email": "ziye.yang@intel.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/1536587210-35122-1-git-send-email-ziye.yang@intel.com/mbox/",
    "series": [
        {
            "id": 1250,
            "url": "https://patches.dpdk.org/api/series/1250/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1250",
            "date": "2018-09-10T13:46:50",
            "name": "[v6] linuxapp, eal: Fix the memory leak issue of logid",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/1250/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/44511/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/44511/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 658334C91;\n\tMon, 10 Sep 2018 15:47:02 +0200 (CEST)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id 74C5811A4\n\tfor <dev@dpdk.org>; Mon, 10 Sep 2018 15:47:01 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t10 Sep 2018 06:47:00 -0700",
            "from ziyeyang-mobl.ccr.corp.intel.com (HELO localhost.localdomain)\n\t([10.254.213.36])\n\tby fmsmga002.fm.intel.com with ESMTP; 10 Sep 2018 06:46:59 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.53,355,1531810800\"; d=\"scan'208\";a=\"84638284\"",
        "From": "Ziye Yang <ziye.yang@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "konstantin.ananyev@intel.com,\n\tZiye Yang <optimistyzy@gmail.com>",
        "Date": "Mon, 10 Sep 2018 21:46:50 +0800",
        "Message-Id": "<1536587210-35122-1-git-send-email-ziye.yang@intel.com>",
        "X-Mailer": "git-send-email 1.9.3",
        "In-Reply-To": "<1536125954-46632-1-git-send-email-ziye.yang@intel.com>",
        "References": "<1536125954-46632-1-git-send-email-ziye.yang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v6] linuxapp,\n\teal: Fix the memory leak issue of logid",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Ziye Yang <optimistyzy@gmail.com>\n\nThis patch is used to fix the memory leak issue of logid.\nWe use the ASAN test in SPDK when intergrating DPDK and\nfind this memory leak issue.\n\nBy the way, we also fix several missed function call of\nrte_atomic32_clear.\n\nSigned-off-by: Ziye Yang <ziye.yang@intel.com>\n---\n lib/librte_eal/linuxapp/eal/eal.c | 11 +++++++----\n 1 file changed, 7 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c\nindex e59ac65..a1b218a 100644\n--- a/lib/librte_eal/linuxapp/eal/eal.c\n+++ b/lib/librte_eal/linuxapp/eal/eal.c\n@@ -793,7 +793,8 @@ static void rte_eal_init_alert(const char *msg)\n \tint i, fctret, ret;\n \tpthread_t thread_id;\n \tstatic rte_atomic32_t run_once = RTE_ATOMIC32_INIT(0);\n-\tconst char *logid;\n+\tconst char *p;\n+\tstatic char logid[PATH_MAX];\n \tchar cpuset[RTE_CPU_AFFINITY_STR_LEN];\n \tchar thread_name[RTE_MAX_THREAD_NAME_LEN];\n \n@@ -810,9 +811,8 @@ static void rte_eal_init_alert(const char *msg)\n \t\treturn -1;\n \t}\n \n-\tlogid = strrchr(argv[0], '/');\n-\tlogid = strdup(logid ? logid + 1: argv[0]);\n-\n+\tp = strrchr(argv[0], '/');\n+\tsnprintf(logid, sizeof(logid), \"%s\", (p ? p + 1: argv[0]));\n \tthread_id = pthread_self();\n \n \teal_reset_internal_config(&internal_config);\n@@ -823,6 +823,7 @@ static void rte_eal_init_alert(const char *msg)\n \tif (rte_eal_cpu_init() < 0) {\n \t\trte_eal_init_alert(\"Cannot detect lcores.\");\n \t\trte_errno = ENOTSUP;\n+\t\trte_atomic32_clear(&run_once);\n \t\treturn -1;\n \t}\n \n@@ -851,6 +852,7 @@ static void rte_eal_init_alert(const char *msg)\n \n \tif (rte_eal_intr_init() < 0) {\n \t\trte_eal_init_alert(\"Cannot init interrupt-handling thread\\n\");\n+\t\trte_atomic32_clear(&run_once);\n \t\treturn -1;\n \t}\n \n@@ -861,6 +863,7 @@ static void rte_eal_init_alert(const char *msg)\n \t\trte_eal_init_alert(\"failed to init mp channel\\n\");\n \t\tif (rte_eal_process_type() == RTE_PROC_PRIMARY) {\n \t\t\trte_errno = EFAULT;\n+\t\t\trte_atomic32_clear(&run_once);\n \t\t\treturn -1;\n \t\t}\n \t}\n",
    "prefixes": [
        "v6"
    ]
}