@@ -3609,6 +3609,9 @@ static int rebuild_hashes(struct ftrace_hash **filter_hash, struct ftrace_hash *
}
}
+ free_ftrace_hash(temp_hash.filter_hash);
+ free_ftrace_hash(temp_hash.notrace_hash);
+
temp_hash.filter_hash = *filter_hash;
temp_hash.notrace_hash = *notrace_hash;
}
@@ -3703,8 +3706,11 @@ static int ftrace_hash_move_and_update_subops(struct ftrace_ops *subops,
}
ret = rebuild_hashes(&filter_hash, ¬race_hash, ops);
- if (!ret)
+ if (!ret) {
ret = ftrace_update_ops(ops, filter_hash, notrace_hash);
+ free_ftrace_hash(filter_hash);
+ free_ftrace_hash(notrace_hash);
+ }
if (ret) {
/* Put back the original hash */