Skip to contentSkip to conversation

net/mlx5: Replace kfree with kvfree

PATCH In review Chuhong Yuan 3 participants 3 messages Jul 17, 2019 – Jul 18, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net/mlx5: Replace kfree with kvfree

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")

---
Changes in v2:
- Add corresponding Fixes tag

 drivers/net/ethernet/mellanox/mlx5/core/health.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/health.c +1 -1
index 2fe6923f7ce0..9314777d99e3 100644
@@ -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;
 }
 
Signature · 1 line
2.20.1
Acked-by on v2 1/1
#1 lore raw
Quoted 7 lines · 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")

Dave, i guess this can go to net.

Thanks,
Saeed.

Quoted 22 lines

---
Changes in v2:
- Add corresponding Fixes tag

 drivers/net/ethernet/mellanox/mlx5/core/health.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/health.c +1 -1
index 2fe6923f7ce0..9314777d99e3 100644
@@ -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;
 }
maintainer
#2 lore raw

From: Saeed Mahameed <[email protected]>
Date: Thu, 18 Jul 2019 18:38:34 +0000

Quoted 5 lines · Chuhong Yuan
Quoted 4 lines

Variable allocated by kvmalloc should not be freed by kfree. Because it may be allocated by vmalloc.
So replace kfree with kvfree here.

Quoted 7 lines
Quoted 3 lines
Fixes 9b1f298236057 ("net/mlx5: Add support for FW fatal reporter

dump")

Dave, i guess this can go to net.

Ok, applied.