[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bbfd790f-99be-4ee3-a2b8-998f9eee9679@intel.com>
Date: Mon, 11 Aug 2025 08:28:35 -0700
From: Dave Jiang <dave.jiang@...el.com>
To: Akhilesh Patil <akhilesh@...iitb.ac.in>, saeedm@...dia.com,
itayavr@...dia.com, jgg@...pe.ca, Jonathan.Cameron@...wei.com
Cc: linux-kernel@...r.kernel.org, akhileshpatilvnit@...il.com,
skhan@...uxfoundation.org
Subject: Re: [PATCH] fwctl: mlx5: fix memory alloc/free in mlx5ctl_fw_rpc()
On 8/10/25 11:17 AM, Akhilesh Patil wrote:
> 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@...iitb.ac.in>
Reviewed-by: Dave Jiang <dave.jiang@...el.com>
> ---
> 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;
Powered by blists - more mailing lists