On Mon, Aug 24, 2026 at 12:39:06PM +0530, Muhammad Falak R Wani wrote:
> mana_bpf() declares an uninitialized 'ret' and falls through to a
> trailing 'return ret;' after a switch statement whose every case
> (XDP_SETUP_PROG and default) already returns unconditionally. This
> statement is therefore unreachable dead code left over from an
> earlier refactor, and it would return an uninitialized value if it
> were ever reached.
> 
> Drop the unused variable and the unreachable return.
> 
> Signed-off-by: Muhammad Falak R Wani <[email protected]>

Fixes: ed5356b53f07 ("net: mana: Add XDP support")
Reviewed-by: Hamza Mahfooz <[email protected]>

> ---
>  drivers/net/ethernet/microsoft/mana/mana_bpf.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_bpf.c 
> b/drivers/net/ethernet/microsoft/mana/mana_bpf.c
> index 53308e139cbe9..70bb8c9dc3413 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_bpf.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_bpf.c
> @@ -253,7 +253,6 @@ static int mana_xdp_set(struct net_device *ndev, struct 
> bpf_prog *prog,
>  int mana_bpf(struct net_device *ndev, struct netdev_bpf *bpf)
>  {
>       struct netlink_ext_ack *extack = bpf->extack;
> -     int ret;
>  
>       switch (bpf->command) {
>       case XDP_SETUP_PROG:
> @@ -262,6 +261,4 @@ int mana_bpf(struct net_device *ndev, struct netdev_bpf 
> *bpf)
>       default:
>               return -EOPNOTSUPP;
>       }
> -
> -     return ret;
>  }
> -- 
> 2.55.0
> 

Reply via email to