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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ade8145a-b236-4190-8289-2a44c6df0fa4@bootlin.com>
Date: Thu, 16 Oct 2025 09:25:55 +0200
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
 Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>
Cc: Alexandre Torgue <alexandre.torgue@...s.st.com>,
 Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, linux-arm-kernel@...ts.infradead.org,
 linux-stm32@...md-mailman.stormreply.com,
 Maxime Coquelin <mcoquelin.stm32@...il.com>, netdev@...r.kernel.org,
 Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next 4/5] net: stmmac: rearrange tc_init()



On 15/10/2025 18:10, Russell King (Oracle) wrote:
> To make future changes easier, rearrange the use of dma_cap->l3l4fnum
> vs priv->flow_entries_max.
> 
> Always initialise priv->flow_entries_max from dma_cap->l3l4fnum, then
> use priv->flow_entries_max to determine whether we allocate
> priv->flow_entries and set it up.
> 
> This change is safe because tc_init() is only called once from
> stmmac_dvr_probe().
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>

Reviewed-by: Maxime Chevallier <maxime.chevallier@...tlin.com>

> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
> index 97e89a604abd..ef65cf511f3e 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
> @@ -262,10 +262,10 @@ static int tc_init(struct stmmac_priv *priv)
>  	unsigned int count;
>  	int ret, i;
>  
> -	if (dma_cap->l3l4fnum) {
> -		priv->flow_entries_max = dma_cap->l3l4fnum;
> +	priv->flow_entries_max = dma_cap->l3l4fnum;
> +	if (priv->flow_entries_max) {
>  		priv->flow_entries = devm_kcalloc(priv->device,
> -						  dma_cap->l3l4fnum,
> +						  priv->flow_entries_max,
>  						  sizeof(*priv->flow_entries),
>  						  GFP_KERNEL);
>  		if (!priv->flow_entries)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ