Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/2] net/mlx5e: IPsec: Use kvfree() for memory allocated with kvzalloc()
@ 2020-09-21 16:23 Denis Efremov
  2020-09-21 16:23 ` [PATCH 2/2] net/mlx5e: Use kfree() to free fd->g in accel_fs_tcp_create_groups() Denis Efremov
  0 siblings, 1 reply; 3+ messages in thread
From: Denis Efremov @ 2020-09-21 16:23 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Denis Efremov, David S. Miller, Leon Romanovsky, Saeed Mahameed,
	Boris Pismenny, netdev, linux-rdma, linux-kernel

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 <efremov@linux.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
index 429428bbc903..b974f3cd1005 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
@@ -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;
 }
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] net/mlx5e: Use kfree() to free fd->g in accel_fs_tcp_create_groups()
  2020-09-21 16:23 [PATCH 1/2] net/mlx5e: IPsec: Use kvfree() for memory allocated with kvzalloc() Denis Efremov
@ 2020-09-21 16:23 ` Denis Efremov
  2020-09-22  5:21   ` Saeed Mahameed
  0 siblings, 1 reply; 3+ messages in thread
From: Denis Efremov @ 2020-09-21 16:23 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Denis Efremov, David S. Miller, Leon Romanovsky, Saeed Mahameed,
	Boris Pismenny, netdev, linux-rdma, linux-kernel

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 <efremov@linux.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c
index 4cdd9eac647d..97f1594cee11 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c
@@ -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;
 	}
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] net/mlx5e: Use kfree() to free fd->g in accel_fs_tcp_create_groups()
  2020-09-21 16:23 ` [PATCH 2/2] net/mlx5e: Use kfree() to free fd->g in accel_fs_tcp_create_groups() Denis Efremov
@ 2020-09-22  5:21   ` Saeed Mahameed
  0 siblings, 0 replies; 3+ messages in thread
From: Saeed Mahameed @ 2020-09-22  5:21 UTC (permalink / raw)
  To: Denis Efremov, Jakub Kicinski
  Cc: David S. Miller, Leon Romanovsky, Boris Pismenny, netdev,
	linux-rdma, linux-kernel

On Mon, 2020-09-21 at 19:23 +0300, Denis Efremov wrote:
> 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 <efremov@linux.com>
> ---
> 

series applied to net-next-mlx5 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-22  5:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-21 16:23 [PATCH 1/2] net/mlx5e: IPsec: Use kvfree() for memory allocated with kvzalloc() Denis Efremov
2020-09-21 16:23 ` [PATCH 2/2] net/mlx5e: Use kfree() to free fd->g in accel_fs_tcp_create_groups() Denis Efremov
2020-09-22  5:21   ` Saeed Mahameed

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).