Re: [PATCH net] net: ethernet: ti: am65-cpsw: Fix forever loop in cleanup code

From: Sverdlin, Alexander
Date: Thu Sep 26 2024 - 06:25:22 EST


Hi Dan!

On Thu, 2024-09-26 at 12:50 +0300, Dan Carpenter wrote:
> This error handling has a typo.  It should i++ instead of i--.  In the
> original code the error handling will loop until it crashes.
>
> Fixes: da70d184a8c3 ("net: ethernet: ti: am65-cpsw: Introduce multi queue Rx")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

Thanks for fixing this!
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@xxxxxxxxxxx>

> ---
>  drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> index cbe99017cbfa..d253727b160f 100644
> --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> @@ -763,7 +763,7 @@ static int am65_cpsw_nuss_common_open(struct am65_cpsw_common *common)
> k3_udma_glue_disable_rx_chn(rx_chn->rx_chn);
>  
>  fail_rx:
> - for (i = 0; i < common->rx_ch_num_flows; i--)
> + for (i = 0; i < common->rx_ch_num_flows; i++)
>   k3_udma_glue_reset_rx_chn(rx_chn->rx_chn, i, &rx_chn->flows[i],
>     am65_cpsw_nuss_rx_cleanup, 0);
>  

--
Alexander Sverdlin
Siemens AG
www.siemens.com