[PATCH net 1/2] net: stmmac: Premature loop termination check was ignored

Piotr Raczynski piotr.raczynski at intel.com
Tue Mar 14 07:44:03 PDT 2023


On Tue, Mar 14, 2023 at 01:37:58PM +0100, Jochen Henneberg wrote:
> The premature loop termination check makes sense only in case of the
> jump to read_again where the count may have been updated. But
> read_again did not include the check.

Your commit titles and messages seems identical in both patches, someone
may get confused, maybe you could change commit titles at least?

Or since those are very related one liner fixes, maybe combine them into
one?

Also a question, since you in generally goto backwards here, is it guarded from
an infinite loop (during some corner case scenario maybe)?

Other than that looks fine, thanks.
Reviewed-by: Piotr Raczynski <piotr.raczynski at intel.com>

> 
> Fixes: ec222003bd94 ("net: stmmac: Prepare to add Split Header support")
> Signed-off-by: Jochen Henneberg <jh at henneberg-systemdesign.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index e4902a7bb61e..ea51c7c93101 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -5221,10 +5221,10 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
>  			len = 0;
>  		}
>  
> +read_again:
>  		if (count >= limit)
>  			break;
>  
> -read_again:
>  		buf1_len = 0;
>  		buf2_len = 0;
>  		entry = next_entry;
> -- 
> 2.39.2
> 



More information about the linux-arm-kernel mailing list