diff mbox series

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

Message ID ae659b4e-a306-48ca-ac3c-110d64af5981@stanley.mountain (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net] net: ethernet: ti: am65-cpsw: Fix forever loop in cleanup code | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/apply fail Patch does not apply to net-0

Commit Message

Dan Carpenter Sept. 26, 2024, 9:50 a.m. UTC
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@linaro.org>
---
 drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

A. Sverdlin Sept. 26, 2024, 10:23 a.m. UTC | #1
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@linaro.org>

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

> ---
>  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);
>
Roger Quadros Sept. 26, 2024, 12:25 p.m. UTC | #2
On 26/09/2024 12:50, 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@linaro.org>

Reviewed-by: Roger Quadros <rogerq@kernel.org>
Simon Horman Sept. 26, 2024, 3:51 p.m. UTC | #3
On Thu, Sep 26, 2024 at 12:50:45PM +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@linaro.org>

Hi Dan,

Unfortunately this patch didn't apply cleanly to net
which throws our CI off. So, unfortunately, I think it needs to
be rebased and reposted (after the 24h grace period).
Dan Carpenter Sept. 26, 2024, 8:14 p.m. UTC | #4
On Thu, Sep 26, 2024 at 04:51:39PM +0100, Simon Horman wrote:
> On Thu, Sep 26, 2024 at 12:50:45PM +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@linaro.org>
> 
> Hi Dan,
> 
> Unfortunately this patch didn't apply cleanly to net
> which throws our CI off. So, unfortunately, I think it needs to
> be rebased and reposted (after the 24h grace period).

It's not a matter of rebasing...  I guess I accidentally deleted a space
character at the start of the first line of the diff?  Weird.

Anyway, I'll resend.

regards,
dan carpenter
diff mbox series

Patch

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);