gcov: use kzalloc_flex() for allocation
PATCH 1/1 gcov: use kzalloc_flex() for allocation
name[] is a flexible array member and kzalloc_flex() is the proper helper to handle it.
Signed-off-by Rosen Penev <[email protected]>
--- kernel/gcov/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/gcov/fs.c +1 -1
@@ -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) {
Signature · 1 line
2.54.0