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]
Message-ID: <77eaaa44-25af-84c4-91ec-c7b5ec2f6f64@molgen.mpg.de>
Date:   Mon, 12 Jun 2023 08:23:24 +0200
From:   Paul Menzel <pmenzel@...gen.mpg.de>
To:     Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc:     Jesse Brandeburg <jesse.brandeburg@...el.com>,
        Tony Nguyen <anthony.l.nguyen@...el.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        intel-wired-lan@...ts.osuosl.org, kernel-janitors@...r.kernel.org,
        linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [Intel-wired-lan] [PATCH net-next] ice: Remove managed memory
 usage in ice_get_fw_log_cfg()

Dear Christophe,


Thank you for the patch.

Am 11.06.23 um 22:44 schrieb Christophe JAILLET:
> There is no need to use managed memory allocation here. The memory is
> released at the end of the function.
> 
> You kzalloc()/kfree() to simplify the code.

s/You/Use/?


Kind regards,

Paul


> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
>   drivers/net/ethernet/intel/ice/ice_common.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c
> index eb2dc0983776..4b799a5d378a 100644
> --- a/drivers/net/ethernet/intel/ice/ice_common.c
> +++ b/drivers/net/ethernet/intel/ice/ice_common.c
> @@ -834,7 +834,7 @@ static int ice_get_fw_log_cfg(struct ice_hw *hw)
>   	u16 size;
>   
>   	size = sizeof(*config) * ICE_AQC_FW_LOG_ID_MAX;
> -	config = devm_kzalloc(ice_hw_to_dev(hw), size, GFP_KERNEL);
> +	config = kzalloc(size, GFP_KERNEL);
>   	if (!config)
>   		return -ENOMEM;
>   
> @@ -857,7 +857,7 @@ static int ice_get_fw_log_cfg(struct ice_hw *hw)
>   		}
>   	}
>   
> -	devm_kfree(ice_hw_to_dev(hw), config);
> +	kfree(config);
>   
>   	return status;
>   }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ