get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 808304,
    "url": "http://patchwork.ozlabs.org/api/patches/808304/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170831163053.2349-1-colin.king@canonical.com/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170831163053.2349-1-colin.king@canonical.com>",
    "list_archive_url": null,
    "date": "2017-08-31T16:30:53",
    "name": "[next] net/mlx4_core: fix memory leaks on error exit path",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "583bd6b51af74f22fae4aaa298bfdda4a71c1705",
    "submitter": {
        "id": 2900,
        "url": "http://patchwork.ozlabs.org/api/people/2900/?format=api",
        "name": "Colin Ian King",
        "email": "colin.king@canonical.com"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170831163053.2349-1-colin.king@canonical.com/mbox/",
    "series": [
        {
            "id": 869,
            "url": "http://patchwork.ozlabs.org/api/series/869/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=869",
            "date": "2017-08-31T16:30:53",
            "name": "[next] net/mlx4_core: fix memory leaks on error exit path",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/869/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/808304/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/808304/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xjntj431Zz9sPm\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  1 Sep 2017 02:31:09 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751859AbdHaQa5 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 31 Aug 2017 12:30:57 -0400",
            "from youngberry.canonical.com ([91.189.89.112]:52621 \"EHLO\n\tyoungberry.canonical.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751667AbdHaQaz (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 31 Aug 2017 12:30:55 -0400",
            "from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost)\n\tby youngberry.canonical.com with esmtpsa\n\t(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76)\n\t(envelope-from <colin.king@canonical.com>)\n\tid 1dnSMn-0001FH-Qy; Thu, 31 Aug 2017 16:30:54 +0000"
        ],
        "From": "Colin King <colin.king@canonical.com>",
        "To": "Tariq Toukan <tariqt@mellanox.com>, netdev@vger.kernel.org,\n\tlinux-rdma@vger.kernel.org",
        "Cc": "kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org",
        "Subject": "[PATCH][next] net/mlx4_core: fix memory leaks on error exit path",
        "Date": "Thu, 31 Aug 2017 17:30:53 +0100",
        "Message-Id": "<20170831163053.2349-1-colin.king@canonical.com>",
        "X-Mailer": "git-send-email 2.14.1",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "8bit",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "From: Colin Ian King <colin.king@canonical.com>\n\nThe structures hca_param and func_cap are not being kfree'd on an error\nexit path causing two memory leaks. Fix this by jumping to the existing\nfree memory error exit path.\n\nDetected by CoverityScan, CID#1455219, CID#1455224 (\"Resource Leak\")\n\nFixes: c73c8b1e47ca (\"net/mlx4_core: Dynamically allocate structs at mlx4_slave_cap\")\nSigned-off-by: Colin Ian King <colin.king@canonical.com>\n---\n drivers/net/ethernet/mellanox/mlx4/main.c | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c\nindex 1c92101b3ec2..d46f3283ec36 100644\n--- a/drivers/net/ethernet/mellanox/mlx4/main.c\n+++ b/drivers/net/ethernet/mellanox/mlx4/main.c\n@@ -977,7 +977,8 @@ static int mlx4_slave_cap(struct mlx4_dev *dev)\n \tif (dev->caps.num_ports > MLX4_MAX_PORTS) {\n \t\tmlx4_err(dev, \"HCA has %d ports, but we only support %d, aborting\\n\",\n \t\t\t dev->caps.num_ports, MLX4_MAX_PORTS);\n-\t\treturn -ENODEV;\n+\t\terr = -ENODEV;\n+\t\tgoto free_mem;\n \t}\n \n \tmlx4_replace_zero_macs(dev);\n",
    "prefixes": [
        "next"
    ]
}