[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200902085513.748149-3-leon@kernel.org>
Date: Wed, 2 Sep 2020 11:55:11 +0300
From: Leon Romanovsky <leon@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Oberparleiter <oberpar@...ux.ibm.com>
Cc: Leon Romanovsky <leonro@...dia.com>, linux-kernel@...r.kernel.org,
Colin Ian King <colin.king@...onical.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH rdma-next 2/4] gcov: Use proper duplication routine for const pointer
From: Leon Romanovsky <leonro@...dia.com>
The filename is a const pointer, so use the proper string duplication
routine that takes into account const identifier.
Cc: Colin Ian King <colin.king@...onical.com>
Signed-off-by: Leon Romanovsky <leonro@...dia.com>
---
kernel/gcov/gcc_4_7.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c
index 6d706c5eed5c..318211deb903 100644
--- a/kernel/gcov/gcc_4_7.c
+++ b/kernel/gcov/gcc_4_7.c
@@ -283,7 +283,7 @@ struct gcov_info *gcov_info_dup(struct gcov_info *info)
dup->merge[fi_idx] = info->merge[fi_idx];
dup->n_functions = info->n_functions;
- dup->filename = kstrdup(info->filename, GFP_KERNEL);
+ dup->filename = kstrdup_const(info->filename, GFP_KERNEL);
if (!dup->filename)
goto err_free;
@@ -359,7 +359,7 @@ void gcov_info_free(struct gcov_info *info)
free_info:
kfree(info->functions);
- kfree(info->filename);
+ kfree_const(info->filename);
kfree(info);
}
--
2.26.2
Powered by blists - more mailing lists