get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 14888,
    "url": "http://patches.dpdk.org/api/patches/14888/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1468895993-3292-1-git-send-email-yuanhan.liu@linux.intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<1468895993-3292-1-git-send-email-yuanhan.liu@linux.intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1468895993-3292-1-git-send-email-yuanhan.liu@linux.intel.com",
    "date": "2016-07-19T02:39:53",
    "name": "[dpdk-dev] net/virtio: fix crash on null dereference",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "ec98e0fd809c75a5502fa193353c231fcffba375",
    "submitter": {
        "id": 307,
        "url": "http://patches.dpdk.org/api/people/307/?format=api",
        "name": "Yuanhan Liu",
        "email": "yuanhan.liu@linux.intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1468895993-3292-1-git-send-email-yuanhan.liu@linux.intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/14888/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/14888/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 44B222B9D;\n\tTue, 19 Jul 2016 04:36:12 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 92E712B8E\n\tfor <dev@dpdk.org>; Tue, 19 Jul 2016 04:36:10 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga104.fm.intel.com with ESMTP; 18 Jul 2016 19:36:10 -0700",
            "from yliu-dev.sh.intel.com ([10.239.67.162])\n\tby fmsmga004.fm.intel.com with ESMTP; 18 Jul 2016 19:36:08 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.28,387,1464678000\"; d=\"scan'208\";a=\"141601028\"",
        "From": "Yuanhan Liu <yuanhan.liu@linux.intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Thomas Monjalon <thomas.monjalon@6wind.com>,\n\tYuanhan Liu <yuanhan.liu@linux.intel.com>",
        "Date": "Tue, 19 Jul 2016 10:39:53 +0800",
        "Message-Id": "<1468895993-3292-1-git-send-email-yuanhan.liu@linux.intel.com>",
        "X-Mailer": "git-send-email 1.9.0",
        "In-Reply-To": "<95aa6068-2444-304e-2dc1-ff1975f6132a@6wind.com>",
        "References": "<95aa6068-2444-304e-2dc1-ff1975f6132a@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH] net/virtio: fix crash on null dereference",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The rxq/txq for the queue_release callback could be NULL, say when\nrte_eth_dev_configure() fails that the queue is not setup at all.\n\nDo a simple NULL check would fix the crash issue.\n\nFixes: 01ad44fd374f (\"net/virtio: split Rx/Tx queue\")\n\nReported-by: Olivier Matz <olivier.matz@6wind.com>\nSigned-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>\n---\n drivers/net/virtio/virtio_rxtx.c | 30 ++++++++++++++++++++++--------\n 1 file changed, 22 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c\nindex a27208e..2f967de 100644\n--- a/drivers/net/virtio/virtio_rxtx.c\n+++ b/drivers/net/virtio/virtio_rxtx.c\n@@ -467,13 +467,19 @@ void\n virtio_dev_rx_queue_release(void *rxq)\n {\n \tstruct virtnet_rx *rxvq = rxq;\n-\tstruct virtqueue *vq = rxvq->vq;\n-\t/* rxvq is freed when vq is freed, and as mz should be freed after the\n+\tstruct virtqueue *vq;\n+\tconst struct rte_memzone *mz;\n+\n+\tif (rxvq == NULL)\n+\t\treturn;\n+\n+\t/*\n+\t * rxvq is freed when vq is freed, and as mz should be freed after the\n \t * del_queue, so we reserve the mz pointer first.\n \t */\n-\tconst struct rte_memzone *mz = rxvq->mz;\n+\tvq = rxvq->vq;\n+\tmz = rxvq->mz;\n \n-\t/* no need to free rxq as vq and rxq are allocated together */\n \tvirtio_dev_queue_release(vq);\n \trte_memzone_free(mz);\n }\n@@ -553,12 +559,20 @@ void\n virtio_dev_tx_queue_release(void *txq)\n {\n \tstruct virtnet_tx *txvq = txq;\n-\tstruct virtqueue *vq = txvq->vq;\n-\t/* txvq is freed when vq is freed, and as mz should be freed after the\n+\tstruct virtqueue *vq;\n+\tconst struct rte_memzone *mz;\n+\tconst struct rte_memzone *hdr_mz;\n+\n+\tif (txvq == NULL)\n+\t\treturn;\n+\n+\t/*\n+\t * txvq is freed when vq is freed, and as mz should be freed after the\n \t * del_queue, so we reserve the mz pointer first.\n \t */\n-\tconst struct rte_memzone *hdr_mz = txvq->virtio_net_hdr_mz;\n-\tconst struct rte_memzone *mz = txvq->mz;\n+\tvq = txvq->vq;\n+\tmz = txvq->mz;\n+\thdr_mz = txvq->virtio_net_hdr_mz;\n \n \tvirtio_dev_queue_release(vq);\n \trte_memzone_free(mz);\n",
    "prefixes": [
        "dpdk-dev"
    ]
}