From: Jakub Kicinski <jakub.kicin...@netronome.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.

Reply via email to