* [PATCH v2] net/mlx5: Replace kfree with kvfree
@ 2019-07-17 10:14 Chuhong Yuan
2019-07-18 18:38 ` Saeed Mahameed
0 siblings, 1 reply; 3+ messages in thread
From: Chuhong Yuan @ 2019-07-17 10:14 UTC (permalink / raw)
Cc: Saeed Mahameed, Leon Romanovsky, David S . Miller, netdev,
linux-rdma, linux-kernel, Chuhong Yuan
Variable allocated by kvmalloc should not be freed by kfree.
Because it may be allocated by vmalloc.
So replace kfree with kvfree here.
Fixes: 9b1f298236057 ("net/mlx5: Add support for FW fatal reporter dump")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
Changes in v2:
- Add corresponding Fixes tag
drivers/net/ethernet/mellanox/mlx5/core/health.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c b/drivers/net/ethernet/mellanox/mlx5/core/health.c
index 2fe6923f7ce0..9314777d99e3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/health.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c
@@ -597,7 +597,7 @@ mlx5_fw_fatal_reporter_dump(struct devlink_health_reporter *reporter,
err = devlink_fmsg_arr_pair_nest_end(fmsg);
free_data:
- kfree(cr_data);
+ kvfree(cr_data);
return err;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] net/mlx5: Replace kfree with kvfree
2019-07-17 10:14 [PATCH v2] net/mlx5: Replace kfree with kvfree Chuhong Yuan
@ 2019-07-18 18:38 ` Saeed Mahameed
2019-07-18 19:11 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Saeed Mahameed @ 2019-07-18 18:38 UTC (permalink / raw)
To: hslester96; +Cc: linux-rdma, davem, netdev, leon, linux-kernel
On Wed, 2019-07-17 at 18:14 +0800, Chuhong Yuan wrote:
> Variable allocated by kvmalloc should not be freed by kfree.
> Because it may be allocated by vmalloc.
> So replace kfree with kvfree here.
>
> Fixes: 9b1f298236057 ("net/mlx5: Add support for FW fatal reporter
> dump")
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Acked-by: Saeed Mahameed <saeedm@mellanox.com>
Dave, i guess this can go to net.
Thanks,
Saeed.
> ---
> Changes in v2:
> - Add corresponding Fixes tag
>
> drivers/net/ethernet/mellanox/mlx5/core/health.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c
> b/drivers/net/ethernet/mellanox/mlx5/core/health.c
> index 2fe6923f7ce0..9314777d99e3 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/health.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c
> @@ -597,7 +597,7 @@ mlx5_fw_fatal_reporter_dump(struct
> devlink_health_reporter *reporter,
> err = devlink_fmsg_arr_pair_nest_end(fmsg);
>
> free_data:
> - kfree(cr_data);
> + kvfree(cr_data);
> return err;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] net/mlx5: Replace kfree with kvfree
2019-07-18 18:38 ` Saeed Mahameed
@ 2019-07-18 19:11 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2019-07-18 19:11 UTC (permalink / raw)
To: saeedm; +Cc: hslester96, linux-rdma, netdev, leon, linux-kernel
From: Saeed Mahameed <saeedm@mellanox.com>
Date: Thu, 18 Jul 2019 18:38:34 +0000
> On Wed, 2019-07-17 at 18:14 +0800, Chuhong Yuan wrote:
>> Variable allocated by kvmalloc should not be freed by kfree.
>> Because it may be allocated by vmalloc.
>> So replace kfree with kvfree here.
>>
>> Fixes: 9b1f298236057 ("net/mlx5: Add support for FW fatal reporter
>> dump")
>> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
>
> Acked-by: Saeed Mahameed <saeedm@mellanox.com>
>
> Dave, i guess this can go to net.
Ok, applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-18 19:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-17 10:14 [PATCH v2] net/mlx5: Replace kfree with kvfree Chuhong Yuan
2019-07-18 18:38 ` Saeed Mahameed
2019-07-18 19:11 ` David Miller
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).