[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54c22ba9110b299f9f222cd1cffbdfb6ca6024d8.camel@intel.com>
Date: Fri, 8 Nov 2019 18:08:41 +0000
From: "Nguyen, Anthony L" <anthony.l.nguyen@...el.com>
To: "davem@...emloft.net" <davem@...emloft.net>,
"Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>
CC: "nhorman@...hat.com" <nhorman@...hat.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"Venkataramanan, Anirudh" <anirudh.venkataramanan@...el.com>,
"sassmann@...hat.com" <sassmann@...hat.com>,
"Bowers, AndrewX" <andrewx.bowers@...el.com>
Subject: Re: [net-next 01/15] ice: Use ice_ena_vsi and ice_dis_vsi in DCB
configuration flow
On Thu, 2019-11-07 at 16:25 -0800, David Miller wrote:
> From: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
> Date: Thu, 7 Nov 2019 14:14:24 -0800
>
> > @@ -169,15 +170,23 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct
> > ice_dcbx_cfg *new_cfg, bool locked)
> > }
> >
> > /* Store old config in case FW config fails */
> > - old_cfg = devm_kzalloc(&pf->pdev->dev, sizeof(*old_cfg),
> > GFP_KERNEL);
> > - memcpy(old_cfg, curr_cfg, sizeof(*old_cfg));
> > + old_cfg = kmemdup(curr_cfg, sizeof(*old_cfg), GFP_KERNEL);
>
> Why not use devm_kmemdup()? Then you don't have to add the kfree()
> code paths.
https://lore.kernel.org/netdev/20190819161142.6f4cc14d@cakuba.netronome.com/
https://lore.kernel.org/netdev/20190819.165955.1428577625599018007.davem@davemloft.net/
https://lore.kernel.org/netdev/20190819.183158.1151163538921922149.davem@davemloft.net/
Our interpretation of this feedback was that it is unnecessary to use
devres variants of memory allocation/deallocation when memory is
alloc'd and freed in the same function. After getting this feedback, we
are changing the ice driver to follow this guideline and this change is
one of those.
Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (3277 bytes)
Powered by blists - more mailing lists