ftrace: Fix null memory allocation check
Subsystems (3)
PATCH 1/1 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.
Fixes 0ae6b8ce200d ("ftrace: Fix accounting of subop hashes")
Signed-off-by Colin Ian King <[email protected]>
--- kernel/trace/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/ftrace.c +1 -1
@@ -3436,7 +3436,7 @@ static int add_next_hash(struct ftrace_hash **filter_hash, struct ftrace_hash **/* Copy the subops hash */ *filter_hash =alloc_and_copy_ftrace_hash (size_bits, subops_hash->filter_hash); -if (!filter_hash) +if (!*filter_hash)return -ENOMEM ;/* Remove any notrace functions from the copy */ remove_hash (*filter_hash, subops_hash->notrace_hash);
Signature · 1 line
2.49.0