get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 49777,
    "url": "https://patches.dpdk.org/api/patches/49777/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190114033444.13026-2-tiwei.bie@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": "<20190114033444.13026-2-tiwei.bie@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190114033444.13026-2-tiwei.bie@intel.com",
    "date": "2019-01-14T03:34:43",
    "name": "[1/2] vhost: fix memory leak on realloc failure",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "67d220af6ccb87e92ac69696c9025d811abb39e0",
    "submitter": {
        "id": 617,
        "url": "https://patches.dpdk.org/api/people/617/?format=api",
        "name": "Tiwei Bie",
        "email": "tiwei.bie@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190114033444.13026-2-tiwei.bie@intel.com/mbox/",
    "series": [
        {
            "id": 3151,
            "url": "https://patches.dpdk.org/api/series/3151/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=3151",
            "date": "2019-01-14T03:34:42",
            "name": "Fixes for realloc() in vhost",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/3151/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/49777/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/49777/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 5B4F11B484;\n\tMon, 14 Jan 2019 04:37:55 +0100 (CET)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby dpdk.org (Postfix) with ESMTP id AE5EF1B43C;\n\tMon, 14 Jan 2019 04:37:52 +0100 (CET)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Jan 2019 19:37:52 -0800",
            "from dpdk-tbie.sh.intel.com ([10.67.104.173])\n\tby orsmga008.jf.intel.com with ESMTP; 13 Jan 2019 19:37:51 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.56,476,1539673200\"; d=\"scan'208\";a=\"109633051\"",
        "From": "Tiwei Bie <tiwei.bie@intel.com>",
        "To": "maxime.coquelin@redhat.com,\n\tzhihong.wang@intel.com,\n\tdev@dpdk.org",
        "Cc": "stable@dpdk.org",
        "Date": "Mon, 14 Jan 2019 11:34:43 +0800",
        "Message-Id": "<20190114033444.13026-2-tiwei.bie@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190114033444.13026-1-tiwei.bie@intel.com>",
        "References": "<20190114033444.13026-1-tiwei.bie@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 1/2] vhost: fix memory leak on realloc 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": "When realloc() fails, the original block isn't freed.\n\nFixes: e246896178e6 (\"vhost: get guest/host physical address mappings\")\nCc: stable@dpdk.org\n\nSigned-off-by: Tiwei Bie <tiwei.bie@intel.com>\n---\n lib/librte_vhost/vhost_user.c | 3 +++\n 1 file changed, 3 insertions(+)",
    "diff": "diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c\nindex 8fec773d5..5222f77dd 100644\n--- a/lib/librte_vhost/vhost_user.c\n+++ b/lib/librte_vhost/vhost_user.c\n@@ -730,13 +730,16 @@ add_one_guest_page(struct virtio_net *dev, uint64_t guest_phys_addr,\n \t\t   uint64_t host_phys_addr, uint64_t size)\n {\n \tstruct guest_page *page, *last_page;\n+\tstruct guest_page *old_pages;\n \n \tif (dev->nr_guest_pages == dev->max_guest_pages) {\n \t\tdev->max_guest_pages *= 2;\n+\t\told_pages = dev->guest_pages;\n \t\tdev->guest_pages = realloc(dev->guest_pages,\n \t\t\t\t\tdev->max_guest_pages * sizeof(*page));\n \t\tif (!dev->guest_pages) {\n \t\t\tRTE_LOG(ERR, VHOST_CONFIG, \"cannot realloc guest_pages\\n\");\n+\t\t\tfree(old_pages);\n \t\t\treturn -1;\n \t\t}\n \t}\n",
    "prefixes": [
        "1/2"
    ]
}