[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250818235529.GA1098127@nvidia.com>
Date: Mon, 18 Aug 2025 20:55:29 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Akhilesh Patil <akhilesh@...iitb.ac.in>
Cc: saeedm@...dia.com, itayavr@...dia.com, dave.jiang@...el.com,
alison.schofield@...el.com, Jonathan.Cameron@...wei.com,
Markus.Elfring@....de, linux-kernel@...r.kernel.org,
akhileshpatilvnit@...il.com, skhan@...uxfoundation.org
Subject: Re: [PATCH v2] fwctl: mlx5: fix memory alloc/free in mlx5ctl_fw_rpc()
On Sat, Aug 16, 2025 at 11:49:54AM +0530, Akhilesh Patil wrote:
> Use kvfree() to free memory allocated by kvzalloc() instead of kfree().
> Avoid potential memory management issue considering kvzalloc() can
> internally choose to use either kmalloc() or vmalloc() based on memory
> request and current system memory state. Hence, use more appropriate
> kvfree() which automatically determines correct free method to avoid
> potential hard to debug memory issues.
> Fix this issue discovered by running spatch static analysis tool using
> coccinelle script - scripts/coccinelle/api/kfree_mismatch.cocci
>
> 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>
> ---
> changes v1 -> v2:
> - Update commit message with details on why this issue needs to be fixed
> as suggested by Alison <alison.schofield@...el.com>
> - Update commit message with details on how this issue was discovered
> using coccinelle scripts as suggested by Markus <Markus.Elfring@....de>
> - Carry forward Reviewd-by tag from Dave Jiang <dave.jiang@...el.com>
> ---
> drivers/fwctl/mlx5/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to for-rc thanks
Jason
Powered by blists - more mailing lists