]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1838700
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

index 305ad5f5a8130ea3bf5585a907ed2df3d33a4885..2831068e5f28157c354f6e3fc01e2aa3e89926e6 100644 (file)
@@ -2227,7 +2227,7 @@ static struct mlx5_flow_root_namespace *create_root_ns(struct mlx5_flow_steering
        struct mlx5_flow_namespace *ns;
 
        /* 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;