]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net/mlx5: Allocate root ns memory using kzalloc to match kfree
authorParav Pandit <parav@mellanox.com>
Fri, 10 May 2019 15:40:08 +0000 (10:40 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Jun 2019 06:01:29 +0000 (08:01 +0200)
[ Upstream commit 25fa506b70cadb580c1e9cbd836d6417276d4bcd ]

root ns is yet another fs core node which is freed using kfree() by
tree_put_node().
Rest of the other fs core objects are also allocated using kmalloc
variants.

However, root ns memory is allocated using kvzalloc().
Hence allocate root ns memory using kzalloc().

Fixes: 2530236303d9e ("net/mlx5_core: Flow steering tree initialization")
Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

index a49fc4fab3fa401fca732877c878cef330c0df3c..158b941ae911c807356b37d25b95f9fc984671ee 100644 (file)
@@ -2247,7 +2247,7 @@ static struct mlx5_flow_root_namespace
                cmds = mlx5_fs_cmd_get_default_ipsec_fpga_cmds(table_type);
 
        /* Create the root namespace */
-       root_ns = kvzalloc(sizeof(*root_ns), GFP_KERNEL);
+       root_ns = kzalloc(sizeof(*root_ns), GFP_KERNEL);
        if (!root_ns)
                return NULL;