[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190819.165955.1428577625599018007.davem@davemloft.net>
Date: Mon, 19 Aug 2019 16:59:55 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: jakub.kicinski@...ronome.com
Cc: jeffrey.t.kirsher@...el.com, paul.greenwalt@...el.com,
netdev@...r.kernel.org, nhorman@...hat.com, sassmann@...hat.com,
andrewx.bowers@...el.com
Subject: Re: [net-next v2 04/14] ice: fix set pause param autoneg check
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
Date: Mon, 19 Aug 2019 16:11:42 -0700
> On Mon, 19 Aug 2019 09:16:58 -0700, Jeff Kirsher wrote:
>> + pcaps = devm_kzalloc(&vsi->back->pdev->dev, sizeof(*pcaps),
>> + GFP_KERNEL);
>> + if (!pcaps)
>> + return -ENOMEM;
>> +
>> + /* Get current PHY config */
>> + status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_SW_CFG, pcaps,
>> + NULL);
>> + if (status) {
>> + devm_kfree(&vsi->back->pdev->dev, pcaps);
>> + return -EIO;
>> + }
>> +
>> + is_an = ((pcaps->caps & ICE_AQC_PHY_AN_MODE) ?
>> + AUTONEG_ENABLE : AUTONEG_DISABLE);
>> +
>> + devm_kfree(&vsi->back->pdev->dev, pcaps);
>
> Is it just me or is this use of devm_k*alloc absolutely pointless?
Yeah it looks like an overzealous use of these interfaces to me too.
Powered by blists - more mailing lists