futex: remove unnecessary NULL check before kvfree()
PATCH 1/1 futex: remove unnecessary NULL check before kvfree()
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.
--- kernel/futex/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/futex/core.c +1 -2
@@ -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)
Signature · 1 line
2.47.3
Em 30/06/2026 10:35, Vasileios Almpanis escreveu:
Quoted 6 lines
NULL check before
kvfree()is unnecessary and triggers a Coccinelle warning, sincekvfree()handles NULL arguments internally.Reported by
ifnullfree.cocciCoccinelle semantic patch script.Signed-off-by Vasileios Almpanis <[email protected]>
[tip: locking/futex] futex: Remove unnecessary NULL check before kvfree()
In reply to Vasileios AlmpanisThe following commit has been merged into the locking/futex branch of tip:
The following commit has been merged into the locking/futex branch of tip:
Commit-ID: 4903ab0c83f033424879ba7435668f9ebe14f641 Gitweb: https://git.kernel.org/tip/4903ab0c83f033424879ba7435668f9ebe14f641 Author: Vasileios Almpanis <[email protected]> AuthorDate: Tue, 30 Jun 2026 15:35:21 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Sun, 05 Jul 2026 14:50:19 +02:00
futex: Remove unnecessary NULL check before kvfree()
The 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.
--- kernel/futex/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/futex/core.c +1 -2
@@ -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)