ftrace: Reinitialize hash to EMPTY_HASH after freeing

There's several locations that free a ftrace hash pointer but may be
referenced again. Reset them to EMPTY_HASH so that a u-a-f bug doesn't
happen.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/20250417110933.20ab718b@gandalf.local.home
Fixes: 0ae6b8ce200d ("ftrace: Fix accounting of subop hashes")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

+4
+4
kernel/trace/ftrace.c
··· 1297 1297 return; 1298 1298 free_ftrace_hash(ops->func_hash->filter_hash); 1299 1299 free_ftrace_hash(ops->func_hash->notrace_hash); 1300 + ops->func_hash->filter_hash = EMPTY_HASH; 1301 + ops->func_hash->notrace_hash = EMPTY_HASH; 1300 1302 } 1301 1303 EXPORT_SYMBOL_GPL(ftrace_free_filter); 1302 1304 ··· 3445 3443 size_bits); 3446 3444 if (ret < 0) { 3447 3445 free_ftrace_hash(*filter_hash); 3446 + *filter_hash = EMPTY_HASH; 3448 3447 return ret; 3449 3448 } 3450 3449 } ··· 3475 3472 subops_hash->notrace_hash); 3476 3473 if (ret < 0) { 3477 3474 free_ftrace_hash(*notrace_hash); 3475 + *notrace_hash = EMPTY_HASH; 3478 3476 return ret; 3479 3477 } 3480 3478 }