get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1192301,
    "url": "http://patchwork.ozlabs.org/api/patches/1192301/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20191108142331.10221-9-anthony.l.nguyen@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": "<20191108142331.10221-9-anthony.l.nguyen@intel.com>",
    "list_archive_url": null,
    "date": "2019-11-08T14:23:25",
    "name": "[S33,09/15] ice: Do not use devm* functions for local uses",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "6d49e3538e0edcb0444913cdb4ee1195e0f47e2e",
    "submitter": {
        "id": 68875,
        "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api",
        "name": "Tony Nguyen",
        "email": "anthony.l.nguyen@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/20191108142331.10221-9-anthony.l.nguyen@intel.com/mbox/",
    "series": [
        {
            "id": 141798,
            "url": "http://patchwork.ozlabs.org/api/series/141798/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=141798",
            "date": "2019-11-08T14:23:30",
            "name": "[S33,01/15] ice: Store number of functions for the device",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/141798/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1192301/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1192301/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; spf=pass (sender SPF authorized)\n\tsmtp.mailfrom=osuosl.org (client-ip=140.211.166.136;\n\thelo=silver.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 478wZL4fwbz9sPL\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  9 Nov 2019 09:54:34 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 03845242F3;\n\tFri,  8 Nov 2019 22:54:33 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id V2EjubgGbrVc; Fri,  8 Nov 2019 22:54:21 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 6676B24400;\n\tFri,  8 Nov 2019 22:54:21 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id A3B4C1BF5DB\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 Nov 2019 22:54:19 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id A0DF3864EA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 Nov 2019 22:54:19 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 4uYvT4ULmPKP for <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 Nov 2019 22:54:18 +0000 (UTC)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id EA835864DA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 Nov 2019 22:54:17 +0000 (UTC)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t08 Nov 2019 14:54:17 -0800",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.244.174])\n\tby fmsmga008.fm.intel.com with ESMTP; 08 Nov 2019 14:54:17 -0800"
        ],
        "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.68,283,1569308400\"; d=\"scan'208\";a=\"201478834\"",
        "From": "Tony Nguyen <anthony.l.nguyen@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Fri,  8 Nov 2019 06:23:25 -0800",
        "Message-Id": "<20191108142331.10221-9-anthony.l.nguyen@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20191108142331.10221-1-anthony.l.nguyen@intel.com>",
        "References": "<20191108142331.10221-1-anthony.l.nguyen@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH S33 09/15] ice: Do not use devm* functions\n\tfor local uses",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "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>",
        "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": "In situations where we alloc and free memory within the same function do\nnot use the devm_* variants; use regular alloc and free functions. Remove\nany unused vars if there are no usages after these changes.\n\nAlso, replace an allocate and copy with kmemdup() and remove an\nunnecessary memset() to 0 after a kzalloc().\n\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_dcb_lib.c  | 25 +++++----\n drivers/net/ethernet/intel/ice/ice_ethtool.c  | 50 ++++++++---------\n drivers/net/ethernet/intel/ice/ice_lib.c      | 54 +++++++++----------\n drivers/net/ethernet/intel/ice/ice_main.c     | 24 ++++-----\n .../net/ethernet/intel/ice/ice_virtchnl_pf.c  | 15 +++---\n 5 files changed, 80 insertions(+), 88 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\nindex 1150dbd98d0b..06736709968e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n@@ -345,8 +345,7 @@ void ice_dcb_rebuild(struct ice_pf *pf)\n \t}\n \n \t/* Retrieve DCB config and ensure same as current in SW */\n-\tprev_cfg = devm_kmemdup(&pf->pdev->dev, local_dcbx_cfg,\n-\t\t\t\tsizeof(*prev_cfg), GFP_KERNEL);\n+\tprev_cfg = kmemdup(local_dcbx_cfg, sizeof(*prev_cfg), GFP_KERNEL);\n \tif (!prev_cfg) {\n \t\tdev_err(&pf->pdev->dev, \"Failed to alloc space for DCB cfg\\n\");\n \t\tgoto dcb_error;\n@@ -361,11 +360,12 @@ void ice_dcb_rebuild(struct ice_pf *pf)\n \tif (ice_dcb_need_recfg(pf, prev_cfg, local_dcbx_cfg)) {\n \t\t/* difference in cfg detected - disable DCB till next MIB */\n \t\tdev_err(&pf->pdev->dev, \"Set local MIB not accurate\\n\");\n+\t\tkfree(prev_cfg);\n \t\tgoto dcb_error;\n \t}\n \n \t/* fetched config congruent to previous configuration */\n-\tdevm_kfree(&pf->pdev->dev, prev_cfg);\n+\tkfree(prev_cfg);\n \n \t/* Set the local desired config */\n \tif (local_dcbx_cfg->dcbx_mode == ICE_DCBX_MODE_CEE)\n@@ -389,13 +389,16 @@ void ice_dcb_rebuild(struct ice_pf *pf)\n \n dcb_error:\n \tdev_err(&pf->pdev->dev, \"Disabling DCB until new settings occur\\n\");\n-\tprev_cfg = devm_kzalloc(&pf->pdev->dev, sizeof(*prev_cfg), GFP_KERNEL);\n+\tprev_cfg = kzalloc(sizeof(*prev_cfg), GFP_KERNEL);\n+\tif (!prev_cfg)\n+\t\treturn;\n+\n \tprev_cfg->etscfg.willing = true;\n \tprev_cfg->etscfg.tcbwtable[0] = ICE_TC_MAX_BW;\n \tprev_cfg->etscfg.tsatable[0] = ICE_IEEE_TSA_ETS;\n \tmemcpy(&prev_cfg->etsrec, &prev_cfg->etscfg, sizeof(prev_cfg->etsrec));\n \tice_pf_dcb_cfg(pf, prev_cfg, false);\n-\tdevm_kfree(&pf->pdev->dev, prev_cfg);\n+\tkfree(prev_cfg);\n }\n \n /**\n@@ -410,18 +413,17 @@ static int ice_dcb_init_cfg(struct ice_pf *pf, bool locked)\n \tint ret = 0;\n \n \tpi = pf->hw.port_info;\n-\tnewcfg = devm_kzalloc(&pf->pdev->dev, sizeof(*newcfg), GFP_KERNEL);\n+\tnewcfg = kmemdup(&pi->local_dcbx_cfg, sizeof(*newcfg), GFP_KERNEL);\n \tif (!newcfg)\n \t\treturn -ENOMEM;\n \n-\tmemcpy(newcfg, &pi->local_dcbx_cfg, sizeof(*newcfg));\n \tmemset(&pi->local_dcbx_cfg, 0, sizeof(*newcfg));\n \n \tdev_info(&pf->pdev->dev, \"Configuring initial DCB values\\n\");\n \tif (ice_pf_dcb_cfg(pf, newcfg, locked))\n \t\tret = -EINVAL;\n \n-\tdevm_kfree(&pf->pdev->dev, newcfg);\n+\tkfree(newcfg);\n \n \treturn ret;\n }\n@@ -442,9 +444,10 @@ static int ice_dcb_sw_dflt_cfg(struct ice_pf *pf, bool ets_willing, bool locked)\n \n \thw = &pf->hw;\n \tpi = hw->port_info;\n-\tdcbcfg = devm_kzalloc(&pf->pdev->dev, sizeof(*dcbcfg), GFP_KERNEL);\n+\tdcbcfg = kzalloc(sizeof(*dcbcfg), GFP_KERNEL);\n+\tif (!dcbcfg)\n+\t\treturn -ENOMEM;\n \n-\tmemset(dcbcfg, 0, sizeof(*dcbcfg));\n \tmemset(&pi->local_dcbx_cfg, 0, sizeof(*dcbcfg));\n \n \tdcbcfg->etscfg.willing = ets_willing ? 1 : 0;\n@@ -465,7 +468,7 @@ static int ice_dcb_sw_dflt_cfg(struct ice_pf *pf, bool ets_willing, bool locked)\n \tdcbcfg->app[0].prot_id = ICE_APP_PROT_ID_FCOE;\n \n \tret = ice_pf_dcb_cfg(pf, dcbcfg, locked);\n-\tdevm_kfree(&pf->pdev->dev, dcbcfg);\n+\tkfree(dcbcfg);\n \tif (ret)\n \t\treturn ret;\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c\nindex 6c796c5c8edf..0ee78fd1bdfb 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c\n+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c\n@@ -962,7 +962,7 @@ static int ice_set_fec_cfg(struct net_device *netdev, enum ice_fec_mode req_fec)\n \t}\n \n \t/* Get last SW configuration */\n-\tcaps = devm_kzalloc(&vsi->back->pdev->dev, sizeof(*caps), GFP_KERNEL);\n+\tcaps = kzalloc(sizeof(*caps), GFP_KERNEL);\n \tif (!caps)\n \t\treturn -ENOMEM;\n \n@@ -1007,7 +1007,7 @@ static int ice_set_fec_cfg(struct net_device *netdev, enum ice_fec_mode req_fec)\n \t}\n \n done:\n-\tdevm_kfree(&vsi->back->pdev->dev, caps);\n+\tkfree(caps);\n \treturn err;\n }\n \n@@ -1083,7 +1083,7 @@ ice_get_fecparam(struct net_device *netdev, struct ethtool_fecparam *fecparam)\n \t\tbreak;\n \t}\n \n-\tcaps = devm_kzalloc(&vsi->back->pdev->dev, sizeof(*caps), GFP_KERNEL);\n+\tcaps = kzalloc(sizeof(*caps), GFP_KERNEL);\n \tif (!caps)\n \t\treturn -ENOMEM;\n \n@@ -1110,7 +1110,7 @@ ice_get_fecparam(struct net_device *netdev, struct ethtool_fecparam *fecparam)\n \t\tfecparam->fec |= ETHTOOL_FEC_OFF;\n \n done:\n-\tdevm_kfree(&vsi->back->pdev->dev, caps);\n+\tkfree(caps);\n \treturn err;\n }\n \n@@ -2141,7 +2141,7 @@ ice_get_link_ksettings(struct net_device *netdev,\n \t/* flow control is symmetric and always supported */\n \tethtool_link_ksettings_add_link_mode(ks, supported, Pause);\n \n-\tcaps = devm_kzalloc(&vsi->back->pdev->dev, sizeof(*caps), GFP_KERNEL);\n+\tcaps = kzalloc(sizeof(*caps), GFP_KERNEL);\n \tif (!caps)\n \t\treturn -ENOMEM;\n \n@@ -2199,7 +2199,7 @@ ice_get_link_ksettings(struct net_device *netdev,\n \t\tethtool_link_ksettings_add_link_mode(ks, supported, FEC_RS);\n \n done:\n-\tdevm_kfree(&vsi->back->pdev->dev, caps);\n+\tkfree(caps);\n \treturn err;\n }\n \n@@ -2428,8 +2428,7 @@ ice_set_link_ksettings(struct net_device *netdev,\n \t\tusleep_range(TEST_SET_BITS_SLEEP_MIN, TEST_SET_BITS_SLEEP_MAX);\n \t}\n \n-\tabilities = devm_kzalloc(&pf->pdev->dev, sizeof(*abilities),\n-\t\t\t\t GFP_KERNEL);\n+\tabilities = kzalloc(sizeof(*abilities), GFP_KERNEL);\n \tif (!abilities)\n \t\treturn -ENOMEM;\n \n@@ -2521,7 +2520,7 @@ ice_set_link_ksettings(struct net_device *netdev,\n \t}\n \n done:\n-\tdevm_kfree(&pf->pdev->dev, abilities);\n+\tkfree(abilities);\n \tclear_bit(__ICE_CFG_BUSY, pf->state);\n \n \treturn err;\n@@ -2649,8 +2648,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)\n \tnetdev_info(netdev, \"Changing Tx descriptor count from %d to %d\\n\",\n \t\t    vsi->tx_rings[0]->count, new_tx_cnt);\n \n-\ttx_rings = devm_kcalloc(&pf->pdev->dev, vsi->num_txq,\n-\t\t\t\tsizeof(*tx_rings), GFP_KERNEL);\n+\ttx_rings = kcalloc(vsi->num_txq, sizeof(*tx_rings), GFP_KERNEL);\n \tif (!tx_rings) {\n \t\terr = -ENOMEM;\n \t\tgoto done;\n@@ -2666,7 +2664,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)\n \t\tif (err) {\n \t\t\twhile (i--)\n \t\t\t\tice_clean_tx_ring(&tx_rings[i]);\n-\t\t\tdevm_kfree(&pf->pdev->dev, tx_rings);\n+\t\t\tkfree(tx_rings);\n \t\t\tgoto done;\n \t\t}\n \t}\n@@ -2678,8 +2676,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)\n \tnetdev_info(netdev, \"Changing XDP descriptor count from %d to %d\\n\",\n \t\t    vsi->xdp_rings[0]->count, new_tx_cnt);\n \n-\txdp_rings = devm_kcalloc(&pf->pdev->dev, vsi->num_xdp_txq,\n-\t\t\t\t sizeof(*xdp_rings), GFP_KERNEL);\n+\txdp_rings = kcalloc(vsi->num_xdp_txq, sizeof(*xdp_rings), GFP_KERNEL);\n \tif (!xdp_rings) {\n \t\terr = -ENOMEM;\n \t\tgoto free_tx;\n@@ -2695,7 +2692,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)\n \t\tif (err) {\n \t\t\twhile (i--)\n \t\t\t\tice_clean_tx_ring(&xdp_rings[i]);\n-\t\t\tdevm_kfree(&pf->pdev->dev, xdp_rings);\n+\t\t\tkfree(xdp_rings);\n \t\t\tgoto free_tx;\n \t\t}\n \t\tice_set_ring_xdp(&xdp_rings[i]);\n@@ -2709,8 +2706,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)\n \tnetdev_info(netdev, \"Changing Rx descriptor count from %d to %d\\n\",\n \t\t    vsi->rx_rings[0]->count, new_rx_cnt);\n \n-\trx_rings = devm_kcalloc(&pf->pdev->dev, vsi->num_rxq,\n-\t\t\t\tsizeof(*rx_rings), GFP_KERNEL);\n+\trx_rings = kcalloc(vsi->num_rxq, sizeof(*rx_rings), GFP_KERNEL);\n \tif (!rx_rings) {\n \t\terr = -ENOMEM;\n \t\tgoto done;\n@@ -2740,7 +2736,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)\n \t\t\t\ti--;\n \t\t\t\tice_free_rx_ring(&rx_rings[i]);\n \t\t\t}\n-\t\t\tdevm_kfree(&pf->pdev->dev, rx_rings);\n+\t\t\tkfree(rx_rings);\n \t\t\terr = -ENOMEM;\n \t\t\tgoto free_tx;\n \t\t}\n@@ -2758,7 +2754,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)\n \t\t\t\tice_free_tx_ring(vsi->tx_rings[i]);\n \t\t\t\t*vsi->tx_rings[i] = tx_rings[i];\n \t\t\t}\n-\t\t\tdevm_kfree(&pf->pdev->dev, tx_rings);\n+\t\t\tkfree(tx_rings);\n \t\t}\n \n \t\tif (rx_rings) {\n@@ -2776,7 +2772,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)\n \t\t\t\trx_rings[i].next_to_alloc = 0;\n \t\t\t\t*vsi->rx_rings[i] = rx_rings[i];\n \t\t\t}\n-\t\t\tdevm_kfree(&pf->pdev->dev, rx_rings);\n+\t\t\tkfree(rx_rings);\n \t\t}\n \n \t\tif (xdp_rings) {\n@@ -2784,7 +2780,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)\n \t\t\t\tice_free_tx_ring(vsi->xdp_rings[i]);\n \t\t\t\t*vsi->xdp_rings[i] = xdp_rings[i];\n \t\t\t}\n-\t\t\tdevm_kfree(&pf->pdev->dev, xdp_rings);\n+\t\t\tkfree(xdp_rings);\n \t\t}\n \n \t\tvsi->num_tx_desc = new_tx_cnt;\n@@ -2798,7 +2794,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)\n \tif (tx_rings) {\n \t\tice_for_each_txq(vsi, i)\n \t\t\tice_free_tx_ring(&tx_rings[i]);\n-\t\tdevm_kfree(&pf->pdev->dev, tx_rings);\n+\t\tkfree(tx_rings);\n \t}\n \n done:\n@@ -2846,7 +2842,6 @@ ice_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)\n \tstruct ice_netdev_priv *np = netdev_priv(netdev);\n \tstruct ice_port_info *pi = np->vsi->port_info;\n \tstruct ice_aqc_get_phy_caps_data *pcaps;\n-\tstruct ice_vsi *vsi = np->vsi;\n \tstruct ice_dcbx_cfg *dcbx_cfg;\n \tenum ice_status status;\n \n@@ -2856,8 +2851,7 @@ ice_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)\n \n \tdcbx_cfg = &pi->local_dcbx_cfg;\n \n-\tpcaps = devm_kzalloc(&vsi->back->pdev->dev, sizeof(*pcaps),\n-\t\t\t     GFP_KERNEL);\n+\tpcaps = kzalloc(sizeof(*pcaps), GFP_KERNEL);\n \tif (!pcaps)\n \t\treturn;\n \n@@ -2880,7 +2874,7 @@ ice_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)\n \t\tpause->rx_pause = 1;\n \n out:\n-\tdevm_kfree(&vsi->back->pdev->dev, pcaps);\n+\tkfree(pcaps);\n }\n \n /**\n@@ -3061,7 +3055,7 @@ ice_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, u8 *hfunc)\n \t\treturn -EIO;\n \t}\n \n-\tlut = devm_kzalloc(&pf->pdev->dev, vsi->rss_table_size, GFP_KERNEL);\n+\tlut = kzalloc(vsi->rss_table_size, GFP_KERNEL);\n \tif (!lut)\n \t\treturn -ENOMEM;\n \n@@ -3074,7 +3068,7 @@ ice_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, u8 *hfunc)\n \t\tindir[i] = (u32)(lut[i]);\n \n out:\n-\tdevm_kfree(&pf->pdev->dev, lut);\n+\tkfree(lut);\n \treturn ret;\n }\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex d71f7ce0a265..de9f616b163e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -215,7 +215,7 @@ void ice_vsi_delete(struct ice_vsi *vsi)\n \tstruct ice_vsi_ctx *ctxt;\n \tenum ice_status status;\n \n-\tctxt = devm_kzalloc(&pf->pdev->dev, sizeof(*ctxt), GFP_KERNEL);\n+\tctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);\n \tif (!ctxt)\n \t\treturn;\n \n@@ -230,7 +230,7 @@ void ice_vsi_delete(struct ice_vsi *vsi)\n \t\tdev_err(&pf->pdev->dev, \"Failed to delete VSI %i in FW\\n\",\n \t\t\tvsi->vsi_num);\n \n-\tdevm_kfree(&pf->pdev->dev, ctxt);\n+\tkfree(ctxt);\n }\n \n /**\n@@ -746,7 +746,7 @@ static int ice_vsi_init(struct ice_vsi *vsi)\n \tstruct ice_vsi_ctx *ctxt;\n \tint ret = 0;\n \n-\tctxt = devm_kzalloc(&pf->pdev->dev, sizeof(*ctxt), GFP_KERNEL);\n+\tctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);\n \tif (!ctxt)\n \t\treturn -ENOMEM;\n \n@@ -763,7 +763,8 @@ static int ice_vsi_init(struct ice_vsi *vsi)\n \t\tctxt->vf_num = vsi->vf_id + hw->func_caps.vf_base_id;\n \t\tbreak;\n \tdefault:\n-\t\treturn -ENODEV;\n+\t\tret = -ENODEV;\n+\t\tgoto out;\n \t}\n \n \tice_set_dflt_vsi_ctx(ctxt);\n@@ -797,7 +798,8 @@ static int ice_vsi_init(struct ice_vsi *vsi)\n \tif (ret) {\n \t\tdev_err(&pf->pdev->dev,\n \t\t\t\"Add VSI failed, err %d\\n\", ret);\n-\t\treturn -EIO;\n+\t\tret = -EIO;\n+\t\tgoto out;\n \t}\n \n \t/* keep context for update VSI operations */\n@@ -806,7 +808,8 @@ static int ice_vsi_init(struct ice_vsi *vsi)\n \t/* record VSI number returned */\n \tvsi->vsi_num = ctxt->vsi_num;\n \n-\tdevm_kfree(&pf->pdev->dev, ctxt);\n+out:\n+\tkfree(ctxt);\n \treturn ret;\n }\n \n@@ -944,8 +947,7 @@ int ice_vsi_manage_rss_lut(struct ice_vsi *vsi, bool ena)\n \tint err = 0;\n \tu8 *lut;\n \n-\tlut = devm_kzalloc(&vsi->back->pdev->dev, vsi->rss_table_size,\n-\t\t\t   GFP_KERNEL);\n+\tlut = kzalloc(vsi->rss_table_size, GFP_KERNEL);\n \tif (!lut)\n \t\treturn -ENOMEM;\n \n@@ -958,7 +960,7 @@ int ice_vsi_manage_rss_lut(struct ice_vsi *vsi, bool ena)\n \t}\n \n \terr = ice_set_rss(vsi, NULL, lut, vsi->rss_table_size);\n-\tdevm_kfree(&vsi->back->pdev->dev, lut);\n+\tkfree(lut);\n \treturn err;\n }\n \n@@ -976,7 +978,7 @@ static int ice_vsi_cfg_rss_lut_key(struct ice_vsi *vsi)\n \n \tvsi->rss_size = min_t(int, vsi->rss_size, vsi->num_rxq);\n \n-\tlut = devm_kzalloc(&pf->pdev->dev, vsi->rss_table_size, GFP_KERNEL);\n+\tlut = kzalloc(vsi->rss_table_size, GFP_KERNEL);\n \tif (!lut)\n \t\treturn -ENOMEM;\n \n@@ -995,7 +997,7 @@ static int ice_vsi_cfg_rss_lut_key(struct ice_vsi *vsi)\n \t\tgoto ice_vsi_cfg_rss_exit;\n \t}\n \n-\tkey = devm_kzalloc(&pf->pdev->dev, sizeof(*key), GFP_KERNEL);\n+\tkey = kzalloc(sizeof(*key), GFP_KERNEL);\n \tif (!key) {\n \t\terr = -ENOMEM;\n \t\tgoto ice_vsi_cfg_rss_exit;\n@@ -1017,9 +1019,9 @@ static int ice_vsi_cfg_rss_lut_key(struct ice_vsi *vsi)\n \t\terr = -EIO;\n \t}\n \n-\tdevm_kfree(&pf->pdev->dev, key);\n+\tkfree(key);\n ice_vsi_cfg_rss_exit:\n-\tdevm_kfree(&pf->pdev->dev, lut);\n+\tkfree(lut);\n \treturn err;\n }\n \n@@ -1397,13 +1399,12 @@ void ice_vsi_cfg_msix(struct ice_vsi *vsi)\n  */\n int ice_vsi_manage_vlan_insertion(struct ice_vsi *vsi)\n {\n-\tstruct device *dev = &vsi->back->pdev->dev;\n \tstruct ice_hw *hw = &vsi->back->hw;\n \tstruct ice_vsi_ctx *ctxt;\n \tenum ice_status status;\n \tint ret = 0;\n \n-\tctxt = devm_kzalloc(dev, sizeof(*ctxt), GFP_KERNEL);\n+\tctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);\n \tif (!ctxt)\n \t\treturn -ENOMEM;\n \n@@ -1421,7 +1422,7 @@ int ice_vsi_manage_vlan_insertion(struct ice_vsi *vsi)\n \n \tstatus = ice_update_vsi(hw, vsi->idx, ctxt, NULL);\n \tif (status) {\n-\t\tdev_err(dev, \"update VSI for VLAN insert failed, err %d aq_err %d\\n\",\n+\t\tdev_err(&vsi->back->pdev->dev, \"update VSI for VLAN insert failed, err %d aq_err %d\\n\",\n \t\t\tstatus, hw->adminq.sq_last_status);\n \t\tret = -EIO;\n \t\tgoto out;\n@@ -1429,7 +1430,7 @@ int ice_vsi_manage_vlan_insertion(struct ice_vsi *vsi)\n \n \tvsi->info.vlan_flags = ctxt->info.vlan_flags;\n out:\n-\tdevm_kfree(dev, ctxt);\n+\tkfree(ctxt);\n \treturn ret;\n }\n \n@@ -1440,13 +1441,12 @@ int ice_vsi_manage_vlan_insertion(struct ice_vsi *vsi)\n  */\n int ice_vsi_manage_vlan_stripping(struct ice_vsi *vsi, bool ena)\n {\n-\tstruct device *dev = &vsi->back->pdev->dev;\n \tstruct ice_hw *hw = &vsi->back->hw;\n \tstruct ice_vsi_ctx *ctxt;\n \tenum ice_status status;\n \tint ret = 0;\n \n-\tctxt = devm_kzalloc(dev, sizeof(*ctxt), GFP_KERNEL);\n+\tctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);\n \tif (!ctxt)\n \t\treturn -ENOMEM;\n \n@@ -1468,7 +1468,7 @@ int ice_vsi_manage_vlan_stripping(struct ice_vsi *vsi, bool ena)\n \n \tstatus = ice_update_vsi(hw, vsi->idx, ctxt, NULL);\n \tif (status) {\n-\t\tdev_err(dev, \"update VSI for VLAN strip failed, ena = %d err %d aq_err %d\\n\",\n+\t\tdev_err(&vsi->back->pdev->dev, \"update VSI for VLAN strip failed, ena = %d err %d aq_err %d\\n\",\n \t\t\tena, status, hw->adminq.sq_last_status);\n \t\tret = -EIO;\n \t\tgoto out;\n@@ -1476,7 +1476,7 @@ int ice_vsi_manage_vlan_stripping(struct ice_vsi *vsi, bool ena)\n \n \tvsi->info.vlan_flags = ctxt->info.vlan_flags;\n out:\n-\tdevm_kfree(dev, ctxt);\n+\tkfree(ctxt);\n \treturn ret;\n }\n \n@@ -1569,7 +1569,6 @@ int ice_vsi_stop_xdp_tx_rings(struct ice_vsi *vsi)\n int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena, bool vlan_promisc)\n {\n \tstruct ice_vsi_ctx *ctxt;\n-\tstruct device *dev;\n \tstruct ice_pf *pf;\n \tint status;\n \n@@ -1577,8 +1576,7 @@ int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena, bool vlan_promisc)\n \t\treturn -EINVAL;\n \n \tpf = vsi->back;\n-\tdev = &pf->pdev->dev;\n-\tctxt = devm_kzalloc(dev, sizeof(*ctxt), GFP_KERNEL);\n+\tctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);\n \tif (!ctxt)\n \t\treturn -ENOMEM;\n \n@@ -1612,11 +1610,11 @@ int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena, bool vlan_promisc)\n \tvsi->info.sec_flags = ctxt->info.sec_flags;\n \tvsi->info.sw_flags2 = ctxt->info.sw_flags2;\n \n-\tdevm_kfree(dev, ctxt);\n+\tkfree(ctxt);\n \treturn 0;\n \n err_out:\n-\tdevm_kfree(dev, ctxt);\n+\tkfree(ctxt);\n \treturn -EIO;\n }\n \n@@ -2548,7 +2546,7 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc)\n \tvsi->tc_cfg.ena_tc = ena_tc;\n \tvsi->tc_cfg.numtc = num_tc;\n \n-\tctx = devm_kzalloc(&pf->pdev->dev, sizeof(*ctx), GFP_KERNEL);\n+\tctx = kzalloc(sizeof(*ctx), GFP_KERNEL);\n \tif (!ctx)\n \t\treturn -ENOMEM;\n \n@@ -2581,7 +2579,7 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc)\n \n \tice_vsi_cfg_netdev_tc(vsi, ena_tc);\n out:\n-\tdevm_kfree(&pf->pdev->dev, ctx);\n+\tkfree(ctx);\n \treturn ret;\n }\n #endif /* CONFIG_DCB */\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex 5681e3be81f2..0f68910ba87d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -724,7 +724,7 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup)\n \t\tan = \"False\";\n \n \t/* Get FEC mode requested based on PHY caps last SW configuration */\n-\tcaps = devm_kzalloc(&vsi->back->pdev->dev, sizeof(*caps), GFP_KERNEL);\n+\tcaps = kzalloc(sizeof(*caps), GFP_KERNEL);\n \tif (!caps) {\n \t\tfec_req = \"Unknown\";\n \t\tgoto done;\n@@ -744,7 +744,7 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup)\n \telse\n \t\tfec_req = \"NONE\";\n \n-\tdevm_kfree(&vsi->back->pdev->dev, caps);\n+\tkfree(caps);\n \n done:\n \tnetdev_info(vsi->netdev, \"NIC Link is up %sbps, Requested FEC: %s, FEC: %s, Autoneg: %s, Flow Control: %s\\n\",\n@@ -1011,8 +1011,7 @@ static int __ice_clean_ctrlq(struct ice_pf *pf, enum ice_ctl_q q_type)\n \t}\n \n \tevent.buf_len = cq->rq_buf_size;\n-\tevent.msg_buf = devm_kzalloc(&pf->pdev->dev, event.buf_len,\n-\t\t\t\t     GFP_KERNEL);\n+\tevent.msg_buf = kzalloc(event.buf_len, GFP_KERNEL);\n \tif (!event.msg_buf)\n \t\treturn 0;\n \n@@ -1055,7 +1054,7 @@ static int __ice_clean_ctrlq(struct ice_pf *pf, enum ice_ctl_q q_type)\n \t\t}\n \t} while (pending && (i++ < ICE_DFLT_IRQ_WORK));\n \n-\tdevm_kfree(&pf->pdev->dev, event.msg_buf);\n+\tkfree(event.msg_buf);\n \n \treturn pending && (i == ICE_DFLT_IRQ_WORK);\n }\n@@ -1370,7 +1369,7 @@ static int ice_force_phys_link_state(struct ice_vsi *vsi, bool link_up)\n \n \tpi = vsi->port_info;\n \n-\tpcaps = devm_kzalloc(dev, sizeof(*pcaps), GFP_KERNEL);\n+\tpcaps = kzalloc(sizeof(*pcaps), GFP_KERNEL);\n \tif (!pcaps)\n \t\treturn -ENOMEM;\n \n@@ -1389,7 +1388,7 @@ static int ice_force_phys_link_state(struct ice_vsi *vsi, bool link_up)\n \t    link_up == !!(pi->phy.link_info.link_info & ICE_AQ_LINK_UP))\n \t\tgoto out;\n \n-\tcfg = devm_kzalloc(dev, sizeof(*cfg), GFP_KERNEL);\n+\tcfg = kzalloc(sizeof(*cfg), GFP_KERNEL);\n \tif (!cfg) {\n \t\tretcode = -ENOMEM;\n \t\tgoto out;\n@@ -1414,9 +1413,9 @@ static int ice_force_phys_link_state(struct ice_vsi *vsi, bool link_up)\n \t\tretcode = -EIO;\n \t}\n \n-\tdevm_kfree(dev, cfg);\n+\tkfree(cfg);\n out:\n-\tdevm_kfree(dev, pcaps);\n+\tkfree(pcaps);\n \treturn retcode;\n }\n \n@@ -4866,7 +4865,6 @@ ice_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,\n  */\n static int ice_vsi_update_bridge_mode(struct ice_vsi *vsi, u16 bmode)\n {\n-\tstruct device *dev = &vsi->back->pdev->dev;\n \tstruct ice_aqc_vsi_props *vsi_props;\n \tstruct ice_hw *hw = &vsi->back->hw;\n \tstruct ice_vsi_ctx *ctxt;\n@@ -4875,7 +4873,7 @@ static int ice_vsi_update_bridge_mode(struct ice_vsi *vsi, u16 bmode)\n \n \tvsi_props = &vsi->info;\n \n-\tctxt = devm_kzalloc(dev, sizeof(*ctxt), GFP_KERNEL);\n+\tctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);\n \tif (!ctxt)\n \t\treturn -ENOMEM;\n \n@@ -4891,7 +4889,7 @@ static int ice_vsi_update_bridge_mode(struct ice_vsi *vsi, u16 bmode)\n \n \tstatus = ice_update_vsi(hw, vsi->idx, ctxt, NULL);\n \tif (status) {\n-\t\tdev_err(dev, \"update VSI for bridge mode failed, bmode = %d err %d aq_err %d\\n\",\n+\t\tdev_err(&vsi->back->pdev->dev, \"update VSI for bridge mode failed, bmode = %d err %d aq_err %d\\n\",\n \t\t\tbmode, status, hw->adminq.sq_last_status);\n \t\tret = -EIO;\n \t\tgoto out;\n@@ -4900,7 +4898,7 @@ static int ice_vsi_update_bridge_mode(struct ice_vsi *vsi, u16 bmode)\n \tvsi_props->sw_flags = ctxt->info.sw_flags;\n \n out:\n-\tdevm_kfree(dev, ctxt);\n+\tkfree(ctxt);\n \treturn ret;\n }\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\nindex 869111a45d61..565fc9780ebe 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n@@ -459,13 +459,12 @@ static void ice_vsi_kill_pvid_fill_ctxt(struct ice_vsi_ctx *ctxt)\n  */\n static int ice_vsi_manage_pvid(struct ice_vsi *vsi, u16 vid, bool enable)\n {\n-\tstruct device *dev = &vsi->back->pdev->dev;\n \tstruct ice_hw *hw = &vsi->back->hw;\n \tstruct ice_vsi_ctx *ctxt;\n \tenum ice_status status;\n \tint ret = 0;\n \n-\tctxt = devm_kzalloc(dev, sizeof(*ctxt), GFP_KERNEL);\n+\tctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);\n \tif (!ctxt)\n \t\treturn -ENOMEM;\n \n@@ -477,7 +476,7 @@ static int ice_vsi_manage_pvid(struct ice_vsi *vsi, u16 vid, bool enable)\n \n \tstatus = ice_update_vsi(hw, vsi->idx, ctxt, NULL);\n \tif (status) {\n-\t\tdev_info(dev, \"update VSI for port VLAN failed, err %d aq_err %d\\n\",\n+\t\tdev_info(&vsi->back->pdev->dev, \"update VSI for port VLAN failed, err %d aq_err %d\\n\",\n \t\t\t status, hw->adminq.sq_last_status);\n \t\tret = -EIO;\n \t\tgoto out;\n@@ -485,7 +484,7 @@ static int ice_vsi_manage_pvid(struct ice_vsi *vsi, u16 vid, bool enable)\n \n \tvsi->info = ctxt->info;\n out:\n-\tdevm_kfree(dev, ctxt);\n+\tkfree(ctxt);\n \treturn ret;\n }\n \n@@ -1624,7 +1623,7 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg)\n \n \tlen = sizeof(struct virtchnl_vf_resource);\n \n-\tvfres = devm_kzalloc(&pf->pdev->dev, len, GFP_KERNEL);\n+\tvfres = kzalloc(len, GFP_KERNEL);\n \tif (!vfres) {\n \t\tv_ret = VIRTCHNL_STATUS_ERR_NO_MEMORY;\n \t\tlen = 0;\n@@ -1700,7 +1699,7 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg)\n \tret = ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_GET_VF_RESOURCES, v_ret,\n \t\t\t\t    (u8 *)vfres, len);\n \n-\tdevm_kfree(&pf->pdev->dev, vfres);\n+\tkfree(vfres);\n \treturn ret;\n }\n \n@@ -3167,7 +3166,7 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena)\n \t\treturn 0;\n \t}\n \n-\tctx = devm_kzalloc(&pf->pdev->dev, sizeof(*ctx), GFP_KERNEL);\n+\tctx = kzalloc(sizeof(*ctx), GFP_KERNEL);\n \tif (!ctx)\n \t\treturn -ENOMEM;\n \n@@ -3190,7 +3189,7 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena)\n \tvsi->info.sec_flags = ctx->info.sec_flags;\n \tvsi->info.sw_flags2 = ctx->info.sw_flags2;\n out:\n-\tdevm_kfree(&pf->pdev->dev, ctx);\n+\tkfree(ctx);\n \treturn ret;\n }\n \n",
    "prefixes": [
        "S33",
        "09/15"
    ]
}