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.

Signed-off-by: Vasileios Almpanis <vasilisalmpanis@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: André Almeida <andrealmeid@igalia.com>
Link: https://patch.msgid.link/20260630133530.2577832-1-vasilisalmpanis@gmail.com
This commit is contained in:
Vasileios Almpanis
2026-07-05 14:50:19 +02:00
committed by Thomas Gleixner
parent 4a02312098
commit 4903ab0c83
+1 -2
View File
@@ -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)