net/mlx5: DR, Init lists that are used in rule's member
authorErez Shitrit <erezsh@mellanox.com>
Mon, 25 Nov 2019 08:26:24 +0000 (10:26 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Mon, 6 Jan 2020 23:30:05 +0000 (15:30 -0800)
Whenever adding new member of rule object we attach it to 2 lists,
These 2 lists should be initialized first.

Fixes: 41d07074154c ("net/mlx5: DR, Expose steering rule functionality")
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c

index f21bc1bc77d7d94574a5d4d3fec4434c990186c1..e4cff7abb348e1087ed85bfef733a990912ac947 100644 (file)
@@ -638,6 +638,9 @@ static int dr_rule_add_member(struct mlx5dr_rule_rx_tx *nic_rule,
        if (!rule_mem)
                return -ENOMEM;
 
+       INIT_LIST_HEAD(&rule_mem->list);
+       INIT_LIST_HEAD(&rule_mem->use_ste_list);
+
        rule_mem->ste = ste;
        list_add_tail(&rule_mem->list, &nic_rule->rule_members_list);