[bug report] net/mlx5: E-Switch, Move send to vport meta rule creation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Roi Dayan,

The patch 430e2d5e2a98: "net/mlx5: E-Switch, Move send to vport meta
rule creation" from Jul 18, 2022, leads to the following Smatch
static checker warning:

	drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:489 mlx5e_rep_add_meta_tunnel_rule()
	error: uninitialized symbol 'err'.

drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
    466 static int
    467 mlx5e_rep_add_meta_tunnel_rule(struct mlx5e_priv *priv)
    468 {
    469         struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
    470         struct mlx5e_rep_priv *rpriv = priv->ppriv;
    471         struct mlx5_eswitch_rep *rep = rpriv->rep;
    472         struct mlx5_flow_handle *flow_rule;
    473         struct mlx5_flow_group *g;
    474         int err;
    475 
    476         g = esw->fdb_table.offloads.send_to_vport_meta_grp;
    477         if (!g)
    478                 return 0;
    479 
    480         flow_rule = mlx5_eswitch_add_send_to_vport_meta_rule(esw, rep->vport);
    481         if (IS_ERR(flow_rule)) {
    482                 err = PTR_ERR(flow_rule);
    483                 goto out;
    484         }
    485 
    486         rpriv->send_to_vport_meta_rule = flow_rule;
    487 
    488 out:
--> 489         return err;

"err" not initialized on success path.  "goto out;" is 100% suck.
Forgot to set the error code is the canonical bug for do-nothing gotos.

    490 }

regards,
dan carpenter



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux