From: Dave Jiang <dave.jiang@intel.com>
To: Akhilesh Patil <akhilesh@ee.iitb.ac.in>,
saeedm@nvidia.com, itayavr@nvidia.com, jgg@ziepe.ca,
Jonathan.Cameron@huawei.com
Cc: linux-kernel@vger.kernel.org, akhileshpatilvnit@gmail.com,
skhan@linuxfoundation.org
Subject: Re: [PATCH] fwctl: mlx5: fix memory alloc/free in mlx5ctl_fw_rpc()
Date: Mon, 11 Aug 2025 08:28:35 -0700 [thread overview]
Message-ID: <bbfd790f-99be-4ee3-a2b8-998f9eee9679@intel.com> (raw)
In-Reply-To: <aJjiRqLx9TEg2NFj@bhairav-test.ee.iitb.ac.in>
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@ee.iitb.ac.in>
Reviewed-by: Dave Jiang <dave.jiang@intel.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;
next prev parent reply other threads:[~2025-08-11 15:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-10 18:17 Akhilesh Patil
2025-08-11 15:28 ` Dave Jiang [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bbfd790f-99be-4ee3-a2b8-998f9eee9679@intel.com \
--to=dave.jiang@intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=akhilesh@ee.iitb.ac.in \
--cc=akhileshpatilvnit@gmail.com \
--cc=itayavr@nvidia.com \
--cc=jgg@ziepe.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=saeedm@nvidia.com \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®