diff mbox series

[v4,4/9] selftests/bpf: fix uprobe.path leak in bpf_testmod

Message ID 20240801132724.GA8791@redhat.com (mailing list archive)
State Accepted
Commit db61e6a4eee5a7884b2cafeaf407895f253bbaa7
Delegated to: Masami Hiramatsu
Headers show
Series [v4,1/9] uprobes: document the usage of mm->mmap_lock | expand

Commit Message

Oleg Nesterov Aug. 1, 2024, 1:27 p.m. UTC
From: Jiri Olsa <olsajiri@gmail.com>

testmod_unregister_uprobe() forgets to path_put(&uprobe.path).

Signed-off-by: Jiri Olsa <olsajiri@gmail.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

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;
 	}