get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 898799,
    "url": "http://patchwork.ozlabs.org/api/patches/898799/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180416170703.9153-1-anirudh.venkataramanan@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20180416170703.9153-1-anirudh.venkataramanan@intel.com>",
    "list_archive_url": null,
    "date": "2018-04-16T17:07:03",
    "name": "ice: Fix insufficient memory issue in ice_aq_manage_mac_read",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "1425a7cc860b5a4f89e5c997a3bb5e9eddd046bb",
    "submitter": {
        "id": 73601,
        "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api",
        "name": "Anirudh Venkataramanan",
        "email": "anirudh.venkataramanan@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180416170703.9153-1-anirudh.venkataramanan@intel.com/mbox/",
    "series": [
        {
            "id": 39127,
            "url": "http://patchwork.ozlabs.org/api/series/39127/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=39127",
            "date": "2018-04-16T17:07:03",
            "name": "ice: Fix insufficient memory issue in ice_aq_manage_mac_read",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/39127/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/898799/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/898799/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.133; helo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 40Pvv200Smz9s3G\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 17 Apr 2018 03:07:09 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 56DEF88034;\n\tMon, 16 Apr 2018 17:07:07 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id qX1Qx+qleYxq; Mon, 16 Apr 2018 17:07:06 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 20B4888009;\n\tMon, 16 Apr 2018 17:07:06 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 363201C2BAA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 16 Apr 2018 17:07:05 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 32B6987505\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 16 Apr 2018 17:07:05 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id MphM3OqzfGOr for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 16 Apr 2018 17:07:04 +0000 (UTC)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 8973787593\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 16 Apr 2018 17:07:04 +0000 (UTC)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t16 Apr 2018 10:07:03 -0700",
            "from shasta.jf.intel.com ([10.166.241.32])\n\tby orsmga002.jf.intel.com with ESMTP; 16 Apr 2018 10:07:03 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.48,459,1517904000\"; d=\"scan'208\";a=\"51206173\"",
        "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Mon, 16 Apr 2018 10:07:03 -0700",
        "Message-Id": "<20180416170703.9153-1-anirudh.venkataramanan@intel.com>",
        "X-Mailer": "git-send-email 2.14.3",
        "Subject": "[Intel-wired-lan] [PATCH] ice: Fix insufficient memory issue in\n\tice_aq_manage_mac_read",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.24",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "From: Md Fahad Iqbal Polash <md.fahad.iqbal.polash@intel.com>\n\nFor the MAC read operation, the device can return upto two (LAN and WoL)\nMAC addresses. Without access to adequate memory, the device will return\nan error. Fixed this by allocating the right amount of memory. Also, logic\nto detect and copy the LAN MAC address into the port_info structure has\nbeen added. Note that the WoL MAC address is ignored currently as the WoL\nfeature isn't supported yet.\n\nFixes: dc49c7723676 (\"ice: Get MAC/PHY/link info and scheduler topology\")\n\nSigned-off-by: Md Fahad Iqbal Polash <md.fahad.iqbal.polash@intel.com>\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_common.c | 22 +++++++++++++++++-----\n 1 file changed, 17 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c\nindex 21977ec984c4..71d032cc5fa7 100644\n--- a/drivers/net/ethernet/intel/ice/ice_common.c\n+++ b/drivers/net/ethernet/intel/ice/ice_common.c\n@@ -78,6 +78,7 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size,\n \tstruct ice_aq_desc desc;\n \tenum ice_status status;\n \tu16 flags;\n+\tu8 i;\n \n \tcmd = &desc.params.mac_read;\n \n@@ -98,8 +99,16 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size,\n \t\treturn ICE_ERR_CFG;\n \t}\n \n-\tether_addr_copy(hw->port_info->mac.lan_addr, resp->mac_addr);\n-\tether_addr_copy(hw->port_info->mac.perm_addr, resp->mac_addr);\n+\t/* A single port can report up to two (LAN and WoL) addresses */\n+\tfor (i = 0; i < cmd->num_addr; i++)\n+\t\tif (resp[i].addr_type == ICE_AQC_MAN_MAC_ADDR_TYPE_LAN) {\n+\t\t\tether_addr_copy(hw->port_info->mac.lan_addr,\n+\t\t\t\t\tresp[i].mac_addr);\n+\t\t\tether_addr_copy(hw->port_info->mac.perm_addr,\n+\t\t\t\t\tresp[i].mac_addr);\n+\t\t\tbreak;\n+\t\t}\n+\n \treturn 0;\n }\n \n@@ -464,9 +473,12 @@ enum ice_status ice_init_hw(struct ice_hw *hw)\n \tif (status)\n \t\tgoto err_unroll_sched;\n \n-\t/* Get port MAC information */\n-\tmac_buf_len = sizeof(struct ice_aqc_manage_mac_read_resp);\n-\tmac_buf = devm_kzalloc(ice_hw_to_dev(hw), mac_buf_len, GFP_KERNEL);\n+\t/* Get MAC information */\n+\t/* A single port can report up to two (LAN and WoL) addresses */\n+\tmac_buf = devm_kcalloc(ice_hw_to_dev(hw), 2,\n+\t\t\t       sizeof(struct ice_aqc_manage_mac_read_resp),\n+\t\t\t       GFP_KERNEL);\n+\tmac_buf_len = 2 * sizeof(struct ice_aqc_manage_mac_read_resp);\n \n \tif (!mac_buf) {\n \t\tstatus = ICE_ERR_NO_MEMORY;\n",
    "prefixes": []
}