net/mlx5e: Fix error codes in alloc_branch_attr()
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 13 Dec 2023 14:08:57 +0000 (17:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Jan 2024 12:42:29 +0000 (12:42 +0000)
[ Upstream commit d792e5f7f19b95f5ce41ac49df5ead4d280238f4 ]

Set the error code if set_branch_dest_ft() fails.

Fixes: ccbe33003b10 ("net/mlx5e: TC, Don't offload post action rule if not supported")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

index 2cfbacf..25e44ee 100644 (file)
@@ -3776,7 +3776,8 @@ alloc_branch_attr(struct mlx5e_tc_flow *flow,
                break;
        case FLOW_ACTION_ACCEPT:
        case FLOW_ACTION_PIPE:
-               if (set_branch_dest_ft(flow->priv, attr))
+               err = set_branch_dest_ft(flow->priv, attr);
+               if (err)
                        goto out_err;
                break;
        case FLOW_ACTION_JUMP:
@@ -3786,7 +3787,8 @@ alloc_branch_attr(struct mlx5e_tc_flow *flow,
                        goto out_err;
                }
                *jump_count = cond->extval;
-               if (set_branch_dest_ft(flow->priv, attr))
+               err = set_branch_dest_ft(flow->priv, attr);
+               if (err)
                        goto out_err;
                break;
        default: