* [PATCH] gcov: use kzalloc_flex() for allocation
@ 2026-05-19 2:00 Rosen Penev
0 siblings, 0 replies; only message in thread
From: Rosen Penev @ 2026-05-19 2:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Peter Oberparleiter
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-19 2:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-19 2:00 [PATCH] gcov: use kzalloc_flex() for allocation Rosen Penev
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®