Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH, net-next] net/mlx5: Use kfree() to match kzalloc_obj() in mlx5_events_cleanup()
@ 2026-08-18 12:25 lirongqing
  2026-08-18 15:04 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: lirongqing @ 2026-08-18 12:25 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, Mark Bloch,
	Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-rdma, linux-kernel
  Cc: Li RongQing

From: Li RongQing <lirongqing@baidu.com>

dev->priv.events is allocated in mlx5_events_init() with kzalloc_obj(),
which is a kmalloc-family allocator, so it must be released with kfree().

kvfree() happens to work here because it falls back to kfree() for
non-vmalloc addresses, but it is semantically imprecise. Use kfree() to
correctly pair with the allocation and to match the error path in
mlx5_events_init(), which already uses kfree(events).

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/events.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/events.c b/drivers/net/ethernet/mellanox/mlx5/core/events.c
index 4d7f35b..fc5ecce 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/events.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/events.c
@@ -396,7 +396,7 @@ int mlx5_events_init(struct mlx5_core_dev *dev)
 void mlx5_events_cleanup(struct mlx5_core_dev *dev)
 {
 	destroy_workqueue(dev->priv.events->wq);
-	kvfree(dev->priv.events);
+	kfree(dev->priv.events);
 }
 
 void mlx5_events_start(struct mlx5_core_dev *dev)
-- 
2.9.4


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

* Re: [PATCH, net-next] net/mlx5: Use kfree() to match kzalloc_obj() in mlx5_events_cleanup()
  2026-08-18 12:25 [PATCH, net-next] net/mlx5: Use kfree() to match kzalloc_obj() in mlx5_events_cleanup() lirongqing
@ 2026-08-18 15:04 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2026-08-18 15:04 UTC (permalink / raw)
  To: lirongqing
  Cc: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, Mark Bloch,
	Andrew Lunn, David S . Miller, Eric Dumazet, Paolo Abeni, netdev,
	linux-rdma, linux-kernel

On Tue, 18 Aug 2026 20:25:30 +0800 lirongqing wrote:
> dev->priv.events is allocated in mlx5_events_init() with kzalloc_obj(),
> which is a kmalloc-family allocator, so it must be released with kfree().

## Form letter - net-next-closed

The merge window for v7.3 has started, and therefore net-next is closed
for new drivers, features, code refactoring and optimizations.
We will only consider applying net-next patches which were posted
before the announcement:

https://lore.kernel.org/20260816155953.072d73da@kernel.org

Fixes are obviously welcome at any time. net-next patches may be sent
for review and discussion only with an RFC tag.

Please repost when net-next reopens.

See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle
-- 
pw-bot: defer
pv-bot: closed

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

end of thread, other threads:[~2026-08-18 15:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 12:25 [PATCH, net-next] net/mlx5: Use kfree() to match kzalloc_obj() in mlx5_events_cleanup() lirongqing
2026-08-18 15:04 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox