All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fwctl: mlx5: fix memory alloc/free in mlx5ctl_fw_rpc()
@ 2025-08-10 18:17 Akhilesh Patil
  2025-08-11 15:28 ` Dave Jiang
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Akhilesh Patil @ 2025-08-10 18:17 UTC (permalink / raw)
  To: saeedm, itayavr, dave.jiang, jgg, Jonathan.Cameron
  Cc: linux-kernel, akhileshpatilvnit, skhan

Use kvfree() to free memory allocated by kvzalloc() instead of kfree().
Avoid potential memory management issue by matching alloc/free routines.

Fixes: 52929c2142041 ("fwctl/mlx5: Support for communicating with mlx5 fw")
Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
---
 drivers/fwctl/mlx5/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fwctl/mlx5/main.c b/drivers/fwctl/mlx5/main.c
index f93aa0cecdb9..4b379f695eb7 100644
--- a/drivers/fwctl/mlx5/main.c
+++ b/drivers/fwctl/mlx5/main.c
@@ -345,7 +345,7 @@ static void *mlx5ctl_fw_rpc(struct fwctl_uctx *uctx, enum fwctl_rpc_scope scope,
 	 */
 	if (ret && ret != -EREMOTEIO) {
 		if (rpc_out != rpc_in)
-			kfree(rpc_out);
+			kvfree(rpc_out);
 		return ERR_PTR(ret);
 	}
 	return rpc_out;
-- 
2.34.1


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

end of thread, other threads:[~2025-08-18 23:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-10 18:17 [PATCH] fwctl: mlx5: fix memory alloc/free in mlx5ctl_fw_rpc() Akhilesh Patil
2025-08-11 15:28 ` Dave Jiang
2025-08-15 14:40 ` Markus Elfring
2025-08-16  4:43   ` Akhilesh Patil
2025-08-15 18:59 ` Alison Schofield
2025-08-16  4:47   ` Akhilesh Patil
2025-08-16  6:19 ` [PATCH v2] " Akhilesh Patil
2025-08-18 18:33   ` Alison Schofield
2025-08-18 23:53   ` Jason Gunthorpe
2025-08-18 23:55   ` Jason Gunthorpe

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.