Re: [PATCH net-next 2/3] net: stmmac: fpe: Add missing return in stmmac_fpe_init()

From: Maxime Chevallier

Date: Wed Jul 29 2026 - 02:36:47 EST


Hi,

On 7/29/26 03:52, muhammad.nazim.amirul.nazle.asmade@xxxxxxxxxx wrote:
> From: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@xxxxxxxxxx>
>
> When FPE is not supported by the driver, stmmac_fpe_init() prints a
> warning but falls through into the pmac_enabled initialization, which
> should only be reached on supported hardware. Add the missing return
> to prevent this.
>
> Signed-off-by: Rohan G Thomas <rohan.g.thomas@xxxxxxxxxx>
> Signed-off-by: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@xxxxxxxxxx>

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

Thanks,

Maxime

> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c
> index 2f880c5e35b0..3436e962a238 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c
> @@ -174,8 +174,10 @@ void stmmac_fpe_init(struct stmmac_priv *priv)
> &stmmac_mmsv_ops);
>
> if ((!priv->fpe_cfg.reg || !priv->hw->mac->fpe_map_preemption_class) &&
> - priv->dma_cap.fpesel)
> + priv->dma_cap.fpesel) {
> dev_info(priv->device, "FPE is not supported by driver.\n");
> + return;
> + }
>
> /* The preemptive MAC in DWMAC is always enabled, so initialize
> * pmac_enabled to true to reflect the hardware state.