* [PATCH] net/mlx5: fix kfree mismatch in indir_table.c
@ 2021-04-05 2:53 Xiaoming Ni
2021-04-05 4:56 ` Leon Romanovsky
0 siblings, 1 reply; 3+ messages in thread
From: Xiaoming Ni @ 2021-04-05 2:53 UTC (permalink / raw)
To: linux-kernel, vladbu, dlinkin, saeedm, leon, davem, kuba, roid,
dan.carpenter, netdev, linux-rdma
Cc: nixiaoming, xiaoqian9
Memory allocated by kvzalloc() should be freed by kvfree().
Fixes: 34ca65352ddf2 ("net/mlx5: E-Switch, Indirect table infrastructur")
Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>
---
.../net/ethernet/mellanox/mlx5/core/esw/indir_table.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
index 6f6772bf61a2..3da7becc1069 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
@@ -248,7 +248,7 @@ static int mlx5_esw_indir_table_rule_get(struct mlx5_eswitch *esw,
err_ethertype:
kfree(rule);
out:
- kfree(rule_spec);
+ kvfree(rule_spec);
return err;
}
@@ -328,7 +328,7 @@ static int mlx5_create_indir_recirc_group(struct mlx5_eswitch *esw,
e->recirc_cnt = 0;
out:
- kfree(in);
+ kvfree(in);
return err;
}
@@ -347,7 +347,7 @@ static int mlx5_create_indir_fwd_group(struct mlx5_eswitch *esw,
spec = kvzalloc(sizeof(*spec), GFP_KERNEL);
if (!spec) {
- kfree(in);
+ kvfree(in);
return -ENOMEM;
}
@@ -371,8 +371,8 @@ static int mlx5_create_indir_fwd_group(struct mlx5_eswitch *esw,
}
err_out:
- kfree(spec);
- kfree(in);
+ kvfree(spec);
+ kvfree(in);
return err;
}
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net/mlx5: fix kfree mismatch in indir_table.c
2021-04-05 2:53 [PATCH] net/mlx5: fix kfree mismatch in indir_table.c Xiaoming Ni
@ 2021-04-05 4:56 ` Leon Romanovsky
2021-04-07 3:49 ` Saeed Mahameed
0 siblings, 1 reply; 3+ messages in thread
From: Leon Romanovsky @ 2021-04-05 4:56 UTC (permalink / raw)
To: Xiaoming Ni
Cc: linux-kernel, vladbu, dlinkin, saeedm, davem, kuba, roid,
dan.carpenter, netdev, linux-rdma, xiaoqian9
On Mon, Apr 05, 2021 at 10:53:39AM +0800, Xiaoming Ni wrote:
> Memory allocated by kvzalloc() should be freed by kvfree().
>
> Fixes: 34ca65352ddf2 ("net/mlx5: E-Switch, Indirect table infrastructur")
> Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>
> ---
> .../net/ethernet/mellanox/mlx5/core/esw/indir_table.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net/mlx5: fix kfree mismatch in indir_table.c
2021-04-05 4:56 ` Leon Romanovsky
@ 2021-04-07 3:49 ` Saeed Mahameed
0 siblings, 0 replies; 3+ messages in thread
From: Saeed Mahameed @ 2021-04-07 3:49 UTC (permalink / raw)
To: Leon Romanovsky, Xiaoming Ni
Cc: linux-kernel, vladbu, dlinkin, davem, kuba, roid, dan.carpenter,
netdev, linux-rdma, xiaoqian9
On Mon, 2021-04-05 at 07:56 +0300, Leon Romanovsky wrote:
> On Mon, Apr 05, 2021 at 10:53:39AM +0800, Xiaoming Ni wrote:
> > Memory allocated by kvzalloc() should be freed by kvfree().
> >
> > Fixes: 34ca65352ddf2 ("net/mlx5: E-Switch, Indirect table
> > infrastructur")
> > Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>
> > ---
> > .../net/ethernet/mellanox/mlx5/core/esw/indir_table.c | 10 +++++-
> > ----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
>
> Thanks,
> Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Applied to net-mlx5.
Thanks,
Saeed.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-04-07 3:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-05 2:53 [PATCH] net/mlx5: fix kfree mismatch in indir_table.c Xiaoming Ni
2021-04-05 4:56 ` Leon Romanovsky
2021-04-07 3:49 ` Saeed Mahameed
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.