From: Jason Gunthorpe <jgg@nvidia.com>
To: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
Cc: saeedm@nvidia.com, itayavr@nvidia.com, dave.jiang@intel.com,
alison.schofield@intel.com, Jonathan.Cameron@huawei.com,
Markus.Elfring@web.de, linux-kernel@vger.kernel.org,
akhileshpatilvnit@gmail.com, skhan@linuxfoundation.org
Subject: Re: [PATCH v2] fwctl: mlx5: fix memory alloc/free in mlx5ctl_fw_rpc()
Date: Mon, 18 Aug 2025 20:55:29 -0300 [thread overview]
Message-ID: <20250818235529.GA1098127@nvidia.com> (raw)
In-Reply-To: <aKAjCoF9cT3VEbSE@bhairav-test.ee.iitb.ac.in>
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@ee.iitb.ac.in>
> Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
> changes v1 -> v2:
> - Update commit message with details on why this issue needs to be fixed
> as suggested by Alison <alison.schofield@intel.com>
> - Update commit message with details on how this issue was discovered
> using coccinelle scripts as suggested by Markus <Markus.Elfring@web.de>
> - Carry forward Reviewd-by tag from Dave Jiang <dave.jiang@intel.com>
> ---
> drivers/fwctl/mlx5/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to for-rc thanks
Jason
prev parent reply other threads:[~2025-08-18 23:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-10 18:17 [PATCH] " 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 message]
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=20250818235529.GA1098127@nvidia.com \
--to=jgg@nvidia.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=Markus.Elfring@web.de \
--cc=akhilesh@ee.iitb.ac.in \
--cc=akhileshpatilvnit@gmail.com \
--cc=alison.schofield@intel.com \
--cc=dave.jiang@intel.com \
--cc=itayavr@nvidia.com \
--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®