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:
Josh Poimboeuf 2014-05-02 22:55:32 -05:00
parent 8bce2712c7
commit 4bde6c3bbf
1 changed files with 5 additions and 4 deletions

View File

@ -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);