get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 43981,
    "url": "http://patchwork.dpdk.org/api/patches/43981/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1535605761-10196-1-git-send-email-ziye.yang@intel.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": "<1535605761-10196-1-git-send-email-ziye.yang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1535605761-10196-1-git-send-email-ziye.yang@intel.com",
    "date": "2018-08-30T05:09:21",
    "name": "linuxapp, eal: Fix the memory leak issue of logid",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ef331d97da1e81221d32b736d01c5cbde11a81cf",
    "submitter": {
        "id": 407,
        "url": "http://patchwork.dpdk.org/api/people/407/?format=api",
        "name": "Ziye Yang",
        "email": "ziye.yang@intel.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/1535605761-10196-1-git-send-email-ziye.yang@intel.com/mbox/",
    "series": [
        {
            "id": 1099,
            "url": "http://patchwork.dpdk.org/api/series/1099/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=1099",
            "date": "2018-08-30T05:09:21",
            "name": "linuxapp, eal: Fix the memory leak issue of logid",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/1099/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/43981/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/43981/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 38ABA2BF7;\n\tThu, 30 Aug 2018 07:09:42 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 17447F11\n\tfor <dev@dpdk.org>; Thu, 30 Aug 2018 07:09:40 +0200 (CEST)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t29 Aug 2018 22:09:40 -0700",
            "from ziyeyang-mobl.ccr.corp.intel.com (HELO localhost.localdomain)\n\t([10.67.64.110])\n\tby orsmga004.jf.intel.com with ESMTP; 29 Aug 2018 22:09:28 -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,306,1531810800\"; d=\"scan'208\";a=\"228792931\"",
        "From": "Ziye Yang <ziye.yang@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Ziye Yang <optimistyzy@gmail.com>",
        "Date": "Thu, 30 Aug 2018 13:09:21 +0800",
        "Message-Id": "<1535605761-10196-1-git-send-email-ziye.yang@intel.com>",
        "X-Mailer": "git-send-email 1.9.3",
        "Subject": "[dpdk-dev] [PATCH] linuxapp, eal: 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 issue.\n\nSigned-off-by: Ziye Yang <ziye.yang@intel.com>\n---\n lib/librte_eal/linuxapp/eal/eal.c | 30 ++++++++++++++++++++++++++++--\n 1 file changed, 28 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c\nindex e59ac65..af8d73f 100644\n--- a/lib/librte_eal/linuxapp/eal/eal.c\n+++ b/lib/librte_eal/linuxapp/eal/eal.c\n@@ -793,7 +793,7 @@ 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+\tchar *logid;\n \tchar cpuset[RTE_CPU_AFFINITY_STR_LEN];\n \tchar thread_name[RTE_MAX_THREAD_NAME_LEN];\n \n@@ -812,6 +812,12 @@ static void rte_eal_init_alert(const char *msg)\n \n \tlogid = strrchr(argv[0], '/');\n \tlogid = strdup(logid ? logid + 1: argv[0]);\n+\tif (!logid) {\n+\t\trte_eal_init_alert(\"Cannot allocate memory for logid\\n\");\n+\t\trte_errno = ENOMEM;\n+\t\trte_atomic32_clear(&run_once);\n+\t\treturn -1;\n+\t}\n \n \tthread_id = pthread_self();\n \n@@ -823,6 +829,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\tfree(logid);\n \t\treturn -1;\n \t}\n \n@@ -831,6 +838,7 @@ static void rte_eal_init_alert(const char *msg)\n \t\trte_eal_init_alert(\"Invalid 'command line' arguments.\");\n \t\trte_errno = EINVAL;\n \t\trte_atomic32_clear(&run_once);\n+\t\tfree(logid);\n \t\treturn -1;\n \t}\n \n@@ -844,6 +852,7 @@ static void rte_eal_init_alert(const char *msg)\n \tif (eal_option_device_parse()) {\n \t\trte_errno = ENODEV;\n \t\trte_atomic32_clear(&run_once);\n+\t\tfree(logid);\n \t\treturn -1;\n \t}\n \n@@ -851,6 +860,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\tfree(logid);\n \t\treturn -1;\n \t}\n \n@@ -861,6 +871,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\tfree(logid);\n \t\t\treturn -1;\n \t\t}\n \t}\n@@ -869,6 +880,7 @@ static void rte_eal_init_alert(const char *msg)\n \t\trte_eal_init_alert(\"Cannot scan the buses for devices\\n\");\n \t\trte_errno = ENODEV;\n \t\trte_atomic32_clear(&run_once);\n+\t\tfree(logid);\n \t\treturn -1;\n \t}\n \n@@ -893,6 +905,7 @@ static void rte_eal_init_alert(const char *msg)\n \t\t\trte_eal_init_alert(\"Cannot get hugepage information.\");\n \t\t\trte_errno = EACCES;\n \t\t\trte_atomic32_clear(&run_once);\n+\t\t\tfree(logid);\n \t\t\treturn -1;\n \t\t}\n \t}\n@@ -919,6 +932,7 @@ static void rte_eal_init_alert(const char *msg)\n \t\trte_eal_init_alert(\"Cannot init logging.\");\n \t\trte_errno = ENOMEM;\n \t\trte_atomic32_clear(&run_once);\n+\t\tfree(logid);\n \t\treturn -1;\n \t}\n \n@@ -927,6 +941,7 @@ static void rte_eal_init_alert(const char *msg)\n \t\trte_eal_init_alert(\"Cannot init VFIO\\n\");\n \t\trte_errno = EAGAIN;\n \t\trte_atomic32_clear(&run_once);\n+\t\tfree(logid);\n \t\treturn -1;\n \t}\n #endif\n@@ -937,12 +952,14 @@ static void rte_eal_init_alert(const char *msg)\n \tif (rte_eal_memzone_init() < 0) {\n \t\trte_eal_init_alert(\"Cannot init memzone\\n\");\n \t\trte_errno = ENODEV;\n+\t\tfree(logid);\n \t\treturn -1;\n \t}\n \n \tif (rte_eal_memory_init() < 0) {\n \t\trte_eal_init_alert(\"Cannot init memory\\n\");\n \t\trte_errno = ENOMEM;\n+\t\tfree(logid);\n \t\treturn -1;\n \t}\n \n@@ -952,24 +969,28 @@ static void rte_eal_init_alert(const char *msg)\n \tif (rte_eal_malloc_heap_init() < 0) {\n \t\trte_eal_init_alert(\"Cannot init malloc heap\\n\");\n \t\trte_errno = ENODEV;\n+\t\tfree(logid);\n \t\treturn -1;\n \t}\n \n \tif (rte_eal_tailqs_init() < 0) {\n \t\trte_eal_init_alert(\"Cannot init tail queues for objects\\n\");\n \t\trte_errno = EFAULT;\n+\t\tfree(logid);\n \t\treturn -1;\n \t}\n \n \tif (rte_eal_alarm_init() < 0) {\n \t\trte_eal_init_alert(\"Cannot init interrupt-handling thread\\n\");\n \t\t/* rte_eal_alarm_init sets rte_errno on failure. */\n+\t\tfree(logid);\n \t\treturn -1;\n \t}\n \n \tif (rte_eal_timer_init() < 0) {\n \t\trte_eal_init_alert(\"Cannot init HPET or TSC timers\\n\");\n \t\trte_errno = ENOTSUP;\n+\t\tfree(logid);\n \t\treturn -1;\n \t}\n \n@@ -1024,6 +1045,7 @@ static void rte_eal_init_alert(const char *msg)\n \tif (ret) {\n \t\trte_eal_init_alert(\"rte_service_init() failed\\n\");\n \t\trte_errno = ENOEXEC;\n+\t\tfree(logid);\n \t\treturn -1;\n \t}\n \n@@ -1031,13 +1053,16 @@ static void rte_eal_init_alert(const char *msg)\n \tif (rte_bus_probe()) {\n \t\trte_eal_init_alert(\"Cannot probe devices\\n\");\n \t\trte_errno = ENOTSUP;\n+\t\tfree(logid);\n \t\treturn -1;\n \t}\n \n #ifdef VFIO_PRESENT\n \t/* Register mp action after probe() so that we got enough info */\n-\tif (rte_vfio_is_enabled(\"vfio\") && vfio_mp_sync_setup() < 0)\n+\tif (rte_vfio_is_enabled(\"vfio\") && vfio_mp_sync_setup() < 0) {\n+\t\tfree(logid);\n \t\treturn -1;\n+\t}\n #endif\n \n \t/* initialize default service/lcore mappings and start running. Ignore\n@@ -1046,6 +1071,7 @@ static void rte_eal_init_alert(const char *msg)\n \tret = rte_service_start_with_defaults();\n \tif (ret < 0 && ret != -ENOTSUP) {\n \t\trte_errno = ENOEXEC;\n+\t\tfree(logid);\n \t\treturn -1;\n \t}\n \n",
    "prefixes": []
}