Skip to content

Commit 800350a

Browse files
Maor GottliebSaeed Mahameed
authored andcommitted
net/mlx5: Avoid NULL pointer dereference on steering cleanup
On cleanup, when the node is the last child of parent then it calls to tree_put_node on the parent, if the parent's reference count is decremented to 0 (for e.g. when deleting last destination of FTE) then we free the parent as well and vice versa. In such a case we will try to free the parent node again. Increment the parent reference count before cleaning it's children will prevent implicit release of the parent object. Fixes: 0da2d66 ('net/mlx5: Properly remove all steering objects') signed-off-by: Maor Gottlieb <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent b92af5a commit 800350a

File tree

1 file changed

+2
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+2
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2068,8 +2068,10 @@ static void clean_tree(struct fs_node *node)
20682068
struct fs_node *iter;
20692069
struct fs_node *temp;
20702070

2071+
tree_get_node(node);
20712072
list_for_each_entry_safe(iter, temp, &node->children, list)
20722073
clean_tree(iter);
2074+
tree_put_node(node);
20732075
tree_remove_node(node);
20742076
}
20752077
}

0 commit comments

Comments
 (0)