mirror of https://github.com/dynup/kpatch
kmod/core: fix kpatch_num_registered decrement
Oops, kpatch_unregister doesn't decrement kpatch_num_registered whenever it's > 1.
This commit is contained in:
parent
8bce2712c7
commit
4bde6c3bbf
|
@ -575,12 +575,13 @@ int kpatch_unregister(struct kpatch_module *kpmod)
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (kpatch_num_registered == 1) {
|
||||
kpatch_num_registered--;
|
||||
if (!kpatch_num_registered) {
|
||||
ret = unregister_ftrace_function(&kpatch_ftrace_ops);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
WARN(1, "can't unregister ftrace handler");
|
||||
else
|
||||
kpatch_num_registered--;
|
||||
kpatch_num_registered++;
|
||||
}
|
||||
}
|
||||
|
||||
kpatch_remove_funcs_from_filter(funcs, num_funcs);
|
||||
|
|
Loading…
Reference in New Issue