mirror of
https://github.com/dynup/kpatch
synced 2025-01-13 08:30:47 +00:00
Merge pull request #284 from jpoimboe/ftrace-unregister-order
kmod/core: fix ftrace unregister order
This commit is contained in:
commit
cae31c410b
@ -459,22 +459,21 @@ static int kpatch_ftrace_remove_func(unsigned long ip)
|
||||
if (kpatch_get_func(ip))
|
||||
return 0;
|
||||
|
||||
if (kpatch_num_patched == 1) {
|
||||
ret = unregister_ftrace_function(&kpatch_ftrace_ops);
|
||||
if (ret) {
|
||||
pr_err("can't unregister ftrace handler\n");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
kpatch_num_patched--;
|
||||
|
||||
ret = ftrace_set_filter_ip(&kpatch_ftrace_ops, ip, 1, 0);
|
||||
if (ret) {
|
||||
pr_err("can't remove ftrace filter at address 0x%lx\n", ip);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (kpatch_num_patched == 1) {
|
||||
ret = unregister_ftrace_function(&kpatch_ftrace_ops);
|
||||
if (ret) {
|
||||
pr_err("can't unregister ftrace handler\n");
|
||||
ftrace_set_filter_ip(&kpatch_ftrace_ops, ip, 0, 0);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
kpatch_num_patched--;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user