Re: [bug report] mlxsw: spectrum: Apply RIF configuration when joining a LAG

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

 



Hi,

Thanks for the report.

On Wed, Dec 07, 2022 at 05:00:43PM +0300, Dan Carpenter wrote:
> Hello Ido Schimmel,
> 
> The patch 31e1de4f1242: "mlxsw: spectrum: Apply RIF configuration
> when joining a LAG" from Dec 6, 2020, leads to the following Smatch
> static checker warning:
> 
> 	drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:8546 mlxsw_sp_port_vlan_router_join()
> 	warn: missing error code here? 'mlxsw_sp_rif_find_by_dev()' failed. 'err' = '0'
> 
> drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
>     8534 int
>     8535 mlxsw_sp_port_vlan_router_join(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan,
>     8536                                struct net_device *l3_dev,
>     8537                                struct netlink_ext_ack *extack)
>     8538 {
>     8539         struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port_vlan->mlxsw_sp_port->mlxsw_sp;
>     8540         struct mlxsw_sp_rif *rif;
>     8541         int err = 0;
>     8542 
>     8543         mutex_lock(&mlxsw_sp->router->lock);
>     8544         rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, l3_dev);
>     8545         if (!rif)
> --> 8546                 goto out;
>                          ^^^^^^^^
> Is this an error path?

No, it's valid to not have a RIF. See the comment in the caller of this
function:

/* Join a router interface configured on the LAG, if exists */
err = mlxsw_sp_port_vlan_router_join(mlxsw_sp_port->default_vlan,
				     lag_dev, extack);

> 
>     8547 
>     8548         err = __mlxsw_sp_port_vlan_router_join(mlxsw_sp_port_vlan, l3_dev,
>     8549                                                extack);
>     8550 out:
>     8551         mutex_unlock(&mlxsw_sp->router->lock);
>     8552         return err;
>     8553 }
> 
> regards,
> dan carpenter



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux