summaryrefslogtreecommitdiff
path: root/tools/testing/selftests
diff options
context:
space:
mode:
authorDavid Hildenbrand (Arm) <david@kernel.org>2026-08-25 13:20:59 +0200
committerAndrew Morton <akpm@linux-foundation.org>2026-09-30 16:55:02 -0700
commit9b0d791147105c25b211a0859437485b333a83dd (patch)
tree0760c8023900d19070e74736a12cae7ca2f991ce /tools/testing/selftests
parent8cb5180c3f1de7bbf0b3fdad755e9b91f94edd1e (diff)
downloadlinux-next-9b0d791147105c25b211a0859437485b333a83dd.tar.gz
linux-next-9b0d791147105c25b211a0859437485b333a83dd.zip
selftests/mm: khugepaged: remove str_dup() usage
We don't check str_dup() return value and never free it. While both things are irrelevant in practice, let's just clean it up by working on argv[0] directly and avoiding the str_dup(). Nobody after us needs these parts of the argv[0] string anyway. This patch is inspired by previous work from Anshuman Tewari [1]. Link: https://lore.kernel.org/r/20260821114416.12255-1-anshumantewari123@gmail.com [1] Link: https://lore.kernel.org/20260825-remove_str_dup-v1-1-0ba2121a820c@kernel.org Signed-off-by: David Hildenbrand (Arm) <david@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org> Reviewed-by: Anshuman Tewari <anshumantewari123@gmail.com> Reviewed-by: Zi Yan <ziy@nvidia.com> Reviewed-by: Lance Yang <lance.yang@linux.dev> Reviewed-by: Dev Jain <dev.jain@arm.com> Acked-by: Usama Arif <usama.arif@linux.dev> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> Reviewed-by: Barry Song <baohua@kernel.org> Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/testing/selftests')
-rw-r--r--tools/testing/selftests/mm/khugepaged.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/mm/khugepaged.c b/tools/testing/selftests/mm/khugepaged.c
index 1d2d6bd72fd2..83d27d069c41 100644
--- a/tools/testing/selftests/mm/khugepaged.c
+++ b/tools/testing/selftests/mm/khugepaged.c
@@ -1227,7 +1227,7 @@ static void parse_test_type(int argc, char **argv)
return;
}
- buf = strdup(argv[0]);
+ buf = argv[0];
token = strsep(&buf, ":");
if (!strcmp(token, "all")) {