From aa2794b42f17574e2d3588666ef61c48e64e095a Mon Sep 17 00:00:00 2001 From: Jiri Pirko Date: Sun, 23 Feb 2020 08:31:33 +0100 Subject: [PATCH] mlxsw: spectrum_trap: Use err variable instead of directly checking func return value When calling mlxsw_sp_rx_listener(), use err variable instead of directly checking func return value. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller --- drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c index 60205aa3f6a5..28d2c09c867e 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c @@ -199,11 +199,13 @@ static void mlxsw_sp_rx_drop_listener(struct sk_buff *skb, u8 local_port, struct mlxsw_sp_port *mlxsw_sp_port; struct mlxsw_sp *mlxsw_sp; struct devlink *devlink; + int err; mlxsw_sp = devlink_trap_ctx_priv(trap_ctx); mlxsw_sp_port = mlxsw_sp->ports[local_port]; - if (mlxsw_sp_rx_listener(mlxsw_sp, skb, local_port, mlxsw_sp_port)) + err = mlxsw_sp_rx_listener(mlxsw_sp, skb, local_port, mlxsw_sp_port); + if (err) return; devlink = priv_to_devlink(mlxsw_sp->core); @@ -221,11 +223,13 @@ static void mlxsw_sp_rx_exception_listener(struct sk_buff *skb, u8 local_port, struct mlxsw_sp_port *mlxsw_sp_port; struct mlxsw_sp *mlxsw_sp; struct devlink *devlink; + int err; mlxsw_sp = devlink_trap_ctx_priv(trap_ctx); mlxsw_sp_port = mlxsw_sp->ports[local_port]; - if (mlxsw_sp_rx_listener(mlxsw_sp, skb, local_port, mlxsw_sp_port)) + err = mlxsw_sp_rx_listener(mlxsw_sp, skb, local_port, mlxsw_sp_port); + if (err) return; devlink = priv_to_devlink(mlxsw_sp->core); -- 2.30.2