get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 53294,
    "url": "https://patches.dpdk.org/api/patches/53294/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190506134825.20706-1-aconole@redhat.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": "<20190506134825.20706-1-aconole@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190506134825.20706-1-aconole@redhat.com",
    "date": "2019-05-06T13:48:25",
    "name": "[v2] ipc: unlock on failure",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "d172af4334210dc6a60dc9f95ea66329b90c4817",
    "submitter": {
        "id": 332,
        "url": "https://patches.dpdk.org/api/people/332/?format=api",
        "name": "Aaron Conole",
        "email": "aconole@redhat.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/20190506134825.20706-1-aconole@redhat.com/mbox/",
    "series": [
        {
            "id": 4579,
            "url": "https://patches.dpdk.org/api/series/4579/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=4579",
            "date": "2019-05-06T13:48:25",
            "name": "[v2] ipc: unlock on failure",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/4579/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/53294/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/53294/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 A392232A5;\n\tMon,  6 May 2019 15:48:44 +0200 (CEST)",
            "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby dpdk.org (Postfix) with ESMTP id 9E4E8374;\n\tMon,  6 May 2019 15:48:42 +0200 (CEST)",
            "from smtp.corp.redhat.com\n\t(int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id F19DC87622;\n\tMon,  6 May 2019 13:48:41 +0000 (UTC)",
            "from dhcp-25.97.bos.redhat.com (ovpn-124-136.rdu2.redhat.com\n\t[10.10.124.136])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 3659D1001943;\n\tMon,  6 May 2019 13:48:40 +0000 (UTC)"
        ],
        "From": "Aaron Conole <aconole@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "Herakliusz Lipiec <herakliusz.lipiec@intel.com>, stable@dpdk.org,\n\tAnatoly Burakov <anatoly.burakov@intel.com>,\n\tDavid Marchand <dmarchan@redhat.com>",
        "Date": "Mon,  6 May 2019 09:48:25 -0400",
        "Message-Id": "<20190506134825.20706-1-aconole@redhat.com>",
        "In-Reply-To": "<20190506131120.25140-1-aconole@redhat.com>",
        "References": "<20190506131120.25140-1-aconole@redhat.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Scanned-By": "MIMEDefang 2.84 on 10.5.11.22",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]); Mon, 06 May 2019 13:48:42 +0000 (UTC)",
        "Subject": "[dpdk-dev] [PATCH v2] ipc: unlock on failure",
        "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": "Reported by Coverity.\n\nFixes: a2a06860b8c4 (\"ipc: fix memory leak on request failure\")\nCc: Herakliusz Lipiec <herakliusz.lipiec@intel.com>\nCc: stable@dpdk.org\nCc: Anatoly Burakov <anatoly.burakov@intel.com>\nSigned-off-by: Aaron Conole <aconole@redhat.com>\n---\n lib/librte_eal/common/eal_common_proc.c | 34 +++++++++++++------------\n 1 file changed, 18 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c\nindex d23728604..1a2259fe3 100644\n--- a/lib/librte_eal/common/eal_common_proc.c\n+++ b/lib/librte_eal/common/eal_common_proc.c\n@@ -934,7 +934,7 @@ int __rte_experimental\n rte_mp_request_sync(struct rte_mp_msg *req, struct rte_mp_reply *reply,\n \t\tconst struct timespec *ts)\n {\n-\tint dir_fd, ret = 0;\n+\tint dir_fd, ret = -1;\n \tDIR *mp_dir;\n \tstruct dirent *ent;\n \tstruct timeval now;\n@@ -947,7 +947,7 @@ rte_mp_request_sync(struct rte_mp_msg *req, struct rte_mp_reply *reply,\n \treply->msgs = NULL;\n \n \tif (check_input(req) != 0)\n-\t\tgoto err;\n+\t\tgoto end;\n \n \tif (internal_config.no_shconf) {\n \t\tRTE_LOG(DEBUG, EAL, \"No shared files mode enabled, IPC is disabled\\n\");\n@@ -957,7 +957,7 @@ rte_mp_request_sync(struct rte_mp_msg *req, struct rte_mp_reply *reply,\n \tif (gettimeofday(&now, NULL) < 0) {\n \t\tRTE_LOG(ERR, EAL, \"Failed to get current time\\n\");\n \t\trte_errno = errno;\n-\t\tgoto err;\n+\t\tgoto end;\n \t}\n \n \tend.tv_nsec = (now.tv_usec * 1000 + ts->tv_nsec) % 1000000000;\n@@ -969,9 +969,7 @@ rte_mp_request_sync(struct rte_mp_msg *req, struct rte_mp_reply *reply,\n \t\tpthread_mutex_lock(&pending_requests.lock);\n \t\tret = mp_request_sync(eal_mp_socket_path(), req, reply, &end);\n \t\tpthread_mutex_unlock(&pending_requests.lock);\n-\t\tif (ret)\n-\t\t\tgoto err;\n-\t\treturn ret;\n+\t\tgoto end;\n \t}\n \n \t/* for primary process, broadcast request, and collect reply 1 by 1 */\n@@ -979,7 +977,7 @@ rte_mp_request_sync(struct rte_mp_msg *req, struct rte_mp_reply *reply,\n \tif (!mp_dir) {\n \t\tRTE_LOG(ERR, EAL, \"Unable to open directory %s\\n\", mp_dir_path);\n \t\trte_errno = errno;\n-\t\tgoto err;\n+\t\tgoto end;\n \t}\n \n \tdir_fd = dirfd(mp_dir);\n@@ -987,9 +985,8 @@ rte_mp_request_sync(struct rte_mp_msg *req, struct rte_mp_reply *reply,\n \tif (flock(dir_fd, LOCK_SH)) {\n \t\tRTE_LOG(ERR, EAL, \"Unable to lock directory %s\\n\",\n \t\t\tmp_dir_path);\n-\t\tclosedir(mp_dir);\n \t\trte_errno = errno;\n-\t\tgoto err;\n+\t\tgoto close_end;\n \t}\n \n \tpthread_mutex_lock(&pending_requests.lock);\n@@ -1006,21 +1003,26 @@ rte_mp_request_sync(struct rte_mp_msg *req, struct rte_mp_reply *reply,\n \t\t * locks on receive\n \t\t */\n \t\tif (mp_request_sync(path, req, reply, &end))\n-\t\t\tgoto err;\n+\t\t\tgoto unlock_end;\n \t}\n+\tret = 0;\n+\n+unlock_end:\n \tpthread_mutex_unlock(&pending_requests.lock);\n \t/* unlock the directory */\n \tflock(dir_fd, LOCK_UN);\n \n+close_end:\n \t/* dir_fd automatically closed on closedir */\n \tclosedir(mp_dir);\n-\treturn ret;\n \n-err:\n-\tfree(reply->msgs);\n-\treply->nb_received = 0;\n-\treply->msgs = NULL;\n-\treturn -1;\n+end:\n+\tif (ret) {\n+\t\tfree(reply->msgs);\n+\t\treply->nb_received = 0;\n+\t\treply->msgs = NULL;\n+\t}\n+\treturn ret;\n }\n \n int __rte_experimental\n",
    "prefixes": [
        "v2"
    ]
}