All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] futex: remove unnecessary NULL check before kvfree()
@ 2026-06-30 13:35 Vasileios Almpanis
  2026-07-01 12:36 ` André Almeida
  2026-07-05 12:54 ` [tip: locking/futex] futex: Remove " tip-bot2 for Vasileios Almpanis
  0 siblings, 2 replies; 3+ messages in thread
From: Vasileios Almpanis @ 2026-06-30 13:35 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar
  Cc: Peter Zijlstra, Darren Hart, Davidlohr Bueso, André Almeida,
	linux-kernel

NULL check before kvfree() is unnecessary and triggers a Coccinelle
warning, since kvfree() handles NULL arguments internally.

Reported by ifnullfree.cocci Coccinelle semantic patch script.

Signed-off-by: Vasileios Almpanis <vasilisalmpanis@gmail.com>
---
 kernel/futex/core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/futex/core.c b/kernel/futex/core.c
index 179b26e9c934..233b926f5624 100644
--- a/kernel/futex/core.c
+++ b/kernel/futex/core.c
@@ -1746,8 +1746,7 @@ void futex_hash_free(struct mm_struct *mm)
 	free_percpu(mm->futex.phash.ref);
 	kvfree(mm->futex.phash.hash_new);
 	fph = rcu_dereference_raw(mm->futex.phash.hash);
-	if (fph)
-		kvfree(fph);
+	kvfree(fph);
 }
 
 static bool futex_pivot_pending(struct mm_struct *mm)
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-05 12:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-30 13:35 [PATCH 1/1] futex: remove unnecessary NULL check before kvfree() Vasileios Almpanis
2026-07-01 12:36 ` André Almeida
2026-07-05 12:54 ` [tip: locking/futex] futex: Remove " tip-bot2 for Vasileios Almpanis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.