mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
net/mlx5: DR, Fix uninitialized var warning
[ Upstream commit52f7cf70eb
] 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:7838e17253
("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: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b46f6144ab
commit
70299a7027
1 changed files with 4 additions and 1 deletions
|
@ -46,7 +46,7 @@ static int dr_table_set_miss_action_nic(struct mlx5dr_domain *dmn,
|
||||||
int mlx5dr_table_set_miss_action(struct mlx5dr_table *tbl,
|
int mlx5dr_table_set_miss_action(struct mlx5dr_table *tbl,
|
||||||
struct mlx5dr_action *action)
|
struct mlx5dr_action *action)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret = -EOPNOTSUPP;
|
||||||
|
|
||||||
if (action && action->action_type != DR_ACTION_TYP_FT)
|
if (action && action->action_type != DR_ACTION_TYP_FT)
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
@ -67,6 +67,9 @@ int mlx5dr_table_set_miss_action(struct mlx5dr_table *tbl,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
goto out;
|
||||||
|
|
||||||
/* Release old action */
|
/* Release old action */
|
||||||
if (tbl->miss_action)
|
if (tbl->miss_action)
|
||||||
refcount_dec(&tbl->miss_action->refcount);
|
refcount_dec(&tbl->miss_action->refcount);
|
||||||
|
|
Loading…
Reference in a new issue