DORMANTno replies

[PATCH] uprobes: remove unneeded condition

From: Muhammad Usama Anjum <hidden>
Date: 2024-09-06 10:19:00
Also in: linux-perf-users, lkml
Subsystem: performance events subsystem, the rest, uprobes · Maintainers: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo, Namhyung Kim, Linus Torvalds, Masami Hiramatsu, Oleg Nesterov

The area cannot be NULL as we are getting it through container_of().
Hence there is no need to check its validity. Remove the if condition
and return statement.

Fixes: c67907222c56 ("uprobes: use vm_special_mapping close() functionality")
Signed-off-by: Muhammad Usama Anjum <redacted>
---
 kernel/events/uprobes.c | 3 ---
 1 file changed, 3 deletions(-)
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 778f1978538ce..9f864504a7e92 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -1474,9 +1474,6 @@ static void uprobe_clear_state(const struct vm_special_mapping *sm, struct vm_ar
 	delayed_uprobe_remove(NULL, vma->vm_mm);
 	mutex_unlock(&delayed_uprobe_lock);
 
-	if (!area)
-		return;
-
 	put_page(area->pages[0]);
 	kfree(area->bitmap);
 	kfree(area);
-- 
2.39.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help