net/mlx5e: IPsec: Use kvfree() for memory allocated with kvzalloc()
Subsystems (5)
PATCH 1/2 net/mlx5e: IPsec: Use kvfree() for memory allocated with kvzalloc()
Variables flow_group_in, spec in rx_fs_create() are allocated with kvzalloc(). It's incorrect to free them with kfree(). Use kvfree() instead.
Fixes 5e466345291a ("net/mlx5e: IPsec: Add IPsec steering in local NIC RX")
Signed-off-by Denis Efremov <[email protected]>
--- drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c +2 -2
@@ -228,8 +228,8 @@ static int rx_fs_create(struct mlx5e_priv *priv, fs_prot->miss_rule = miss_rule; out: -kfree (flow_group_in); -kfree (spec); +kvfree (flow_group_in); +kvfree (spec);return err; }
Signature · 1 line
2.26.2
PATCH 2/2 net/mlx5e: Use kfree() to free fd->g in accel_fs_tcp_create_groups()
Memory ft->g in accel_fs_tcp_create_groups() is allocaed with kcalloc(). It's excessive to free ft->g with kvfree(). Use kfree() instead.
Signed-off-by Denis Efremov <[email protected]>
--- drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c +1 -1
@@ -191,7 +191,7 @@ static int accel_fs_tcp_create_groups(struct mlx5e_flow_table *ft, ft->g =kcalloc (MLX5E_ACCEL_FS_TCP_NUM_GROUPS ,sizeof (*ft->g),GFP_KERNEL ); in =kvzalloc (inlen,GFP_KERNEL );if (!in || !ft->g) { -kvfree (ft->g); +kfree (ft->g);kvfree (in);return -ENOMEM ; }
Signature · 1 line
2.26.2
Re: [PATCH 2/2] net/mlx5e: Use kfree() to free fd->g in accel_fs_tcp_create_groups()
Quoted 7 lines · Denis Efremov
Memory
ft->ginaccel_fs_tcp_create_groups()is allocaed withkcalloc().
It's excessive to freeft->gwithkvfree(). Usekfree()instead.Signed-off-by Denis Efremov <[email protected]>---
series applied to net-next-mlx5