Skip to content

Commit c46d6d3

Browse files
author
Mohammad Kabat
committed
net/mlx5: DR, Fix uninitialized var warning
Bugzilla: https://bugzilla.redhat.com/2112947 Upstream-status: v6.1-rc8 commit 52f7cf7 Author: YueHaibing <yuehaibing@huawei.com> Date: Thu Nov 10 21:47:07 2022 +0800 net/mlx5: DR, Fix uninitialized var warning Smatch warns this: drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c:81 mlx5dr_table_set_miss_action() error: uninitialized symbol 'ret'. Initializing ret with -EOPNOTSUPP and fix missing action case. Fixes: 7838e17 ("net/mlx5: DR, Expose steering table functionality") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Roi Dayan <roid@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Mohammad Kabat <mkabat@redhat.com>
1 parent 264348e commit c46d6d3

File tree

1 file changed

+4
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/steering

1 file changed

+4
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static int dr_table_set_miss_action_nic(struct mlx5dr_domain *dmn,
4646
int mlx5dr_table_set_miss_action(struct mlx5dr_table *tbl,
4747
struct mlx5dr_action *action)
4848
{
49-
int ret;
49+
int ret = -EOPNOTSUPP;
5050

5151
if (action && action->action_type != DR_ACTION_TYP_FT)
5252
return -EOPNOTSUPP;
@@ -67,6 +67,9 @@ int mlx5dr_table_set_miss_action(struct mlx5dr_table *tbl,
6767
goto out;
6868
}
6969

70+
if (ret)
71+
goto out;
72+
7073
/* Release old action */
7174
if (tbl->miss_action)
7275
refcount_dec(&tbl->miss_action->refcount);

0 commit comments

Comments
 (0)