lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 08 Nov 2019 12:34:14 -0800 (PST)
From:   David Miller <davem@...hat.com>
To:     anthony.l.nguyen@...el.com
Cc:     jeffrey.t.kirsher@...el.com, nhorman@...hat.com,
        netdev@...r.kernel.org, anirudh.venkataramanan@...el.com,
        sassmann@...hat.com, andrewx.bowers@...el.com
Subject: Re: [net-next 01/15] ice: Use ice_ena_vsi and ice_dis_vsi in DCB
 configuration flow

From: "Nguyen, Anthony L" <anthony.l.nguyen@...el.com>
Date: Fri, 8 Nov 2019 18:08:41 +0000

> 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.

Ok.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ