aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
diff options
context:
space:
mode:
authorJiri Olsa <[email protected]>2024-08-01 13:27:24 +0000
committerPeter Zijlstra <[email protected]>2024-08-02 09:30:31 +0000
commitdb61e6a4eee5a7884b2cafeaf407895f253bbaa7 (patch)
treed6080afdd8f0be41345198b608cc36ba78d6fad8 /tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
parentuprobes: simplify error handling for alloc_uprobe() (diff)
downloadkernel-db61e6a4eee5a7884b2cafeaf407895f253bbaa7.tar.gz
kernel-db61e6a4eee5a7884b2cafeaf407895f253bbaa7.zip
selftests/bpf: fix uprobe.path leak in bpf_testmod
testmod_unregister_uprobe() forgets to path_put(&uprobe.path). Signed-off-by: Jiri Olsa <[email protected]> Signed-off-by: Oleg Nesterov <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c')
-rw-r--r--tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
index fd28c1157bd3..72f565af4f82 100644
--- a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
+++ b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
@@ -477,6 +477,7 @@ static void testmod_unregister_uprobe(void)
if (uprobe.offset) {
uprobe_unregister(d_real_inode(uprobe.path.dentry),
uprobe.offset, &uprobe.consumer);
+ path_put(&uprobe.path);
uprobe.offset = 0;
}