]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.48/net-mlx5-allocate-root-ns-memory-using-kzalloc-to-match-kfree.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.19.48 / net-mlx5-allocate-root-ns-memory-using-kzalloc-to-match-kfree.patch
CommitLineData
e201c2e6
GKH
1From foo@baz Fri 31 May 2019 03:21:27 PM PDT
2From: Parav Pandit <parav@mellanox.com>
3Date: Fri, 10 May 2019 10:40:08 -0500
4Subject: net/mlx5: Allocate root ns memory using kzalloc to match kfree
5
6From: Parav Pandit <parav@mellanox.com>
7
8[ Upstream commit 25fa506b70cadb580c1e9cbd836d6417276d4bcd ]
9
10root ns is yet another fs core node which is freed using kfree() by
11tree_put_node().
12Rest of the other fs core objects are also allocated using kmalloc
13variants.
14
15However, root ns memory is allocated using kvzalloc().
16Hence allocate root ns memory using kzalloc().
17
18Fixes: 2530236303d9e ("net/mlx5_core: Flow steering tree initialization")
19Signed-off-by: Parav Pandit <parav@mellanox.com>
20Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
21Reviewed-by: Mark Bloch <markb@mellanox.com>
22Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
23Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24---
25 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 2 +-
26 1 file changed, 1 insertion(+), 1 deletion(-)
27
28--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
29+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
30@@ -2220,7 +2220,7 @@ static struct mlx5_flow_root_namespace
31 cmds = mlx5_fs_cmd_get_default_ipsec_fpga_cmds(table_type);
32
33 /* Create the root namespace */
34- root_ns = kvzalloc(sizeof(*root_ns), GFP_KERNEL);
35+ root_ns = kzalloc(sizeof(*root_ns), GFP_KERNEL);
36 if (!root_ns)
37 return NULL;
38