From: Rosen Penev <rosenp@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Peter Oberparleiter <oberpar@linux.ibm.com>
Subject: [PATCH] gcov: use kzalloc_flex() for allocation
Date: Mon, 18 May 2026 19:00:56 -0700 [thread overview]
Message-ID: <20260519020056.634808-1-rosenp@gmail.com> (raw)
name[] is a flexible array member and kzalloc_flex() is the proper
helper to handle it.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
kernel/gcov/fs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c
index 1d19b1be207a..ad9c0ac8a709 100644
--- a/kernel/gcov/fs.c
+++ b/kernel/gcov/fs.c
@@ -541,7 +541,7 @@ static struct gcov_node *new_node(struct gcov_node *parent,
{
struct gcov_node *node;
- node = kzalloc(sizeof(struct gcov_node) + strlen(name) + 1, GFP_KERNEL);
+ node = kzalloc_flex(*node, name, strlen(name) + 1);
if (!node)
goto err_nomem;
if (info) {
--
2.54.0
reply other threads:[~2026-05-19 2:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260519020056.634808-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oberpar@linux.ibm.com \
/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®