Skip to content

Commit 3c1d9cf

Browse files
ColinIanKingrostedt
authored andcommitted
ftrace: Fix NULL memory allocation check
The check for a failed memory location is incorrectly checking the wrong level of pointer indirection by checking !filter_hash rather than !*filter_hash. Fix this. Cc: asami Hiramatsu <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Link: https://lore.kernel.org/[email protected] Fixes: 0ae6b8c ("ftrace: Fix accounting of subop hashes") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent f5178c4 commit 3c1d9cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/ftrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3436,7 +3436,7 @@ static int add_next_hash(struct ftrace_hash **filter_hash, struct ftrace_hash **
34363436

34373437
/* Copy the subops hash */
34383438
*filter_hash = alloc_and_copy_ftrace_hash(size_bits, subops_hash->filter_hash);
3439-
if (!filter_hash)
3439+
if (!*filter_hash)
34403440
return -ENOMEM;
34413441
/* Remove any notrace functions from the copy */
34423442
remove_hash(*filter_hash, subops_hash->notrace_hash);

0 commit comments

Comments
 (0)