All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] mlxsw: spectrum: Apply RIF configuration when joining a LAG
@ 2022-12-07 14:00 Dan Carpenter
  2022-12-08  9:01 ` Ido Schimmel
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2022-12-07 14:00 UTC (permalink / raw)
  To: idosch; +Cc: kernel-janitors

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?

    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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] mlxsw: spectrum: Apply RIF configuration when joining a LAG
  2022-12-07 14:00 [bug report] mlxsw: spectrum: Apply RIF configuration when joining a LAG Dan Carpenter
@ 2022-12-08  9:01 ` Ido Schimmel
  0 siblings, 0 replies; 2+ messages in thread
From: Ido Schimmel @ 2022-12-08  9:01 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: kernel-janitors

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-08  9:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-07 14:00 [bug report] mlxsw: spectrum: Apply RIF configuration when joining a LAG Dan Carpenter
2022-12-08  9:01 ` Ido Schimmel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.