kmod/core: fix error path for kpatch_verify_symbol_match failure

If kpatch_verify_symbol_match() fails, set the num_funcs variable so
that the ftrace rollback only removes the filter for the affected
functions.
This commit is contained in:
Josh Poimboeuf 2014-06-13 11:18:28 -05:00
parent 579ee5f499
commit 6d951dc996

View File

@ -653,9 +653,11 @@ int kpatch_register(struct kpatch_module *kpmod, bool replace)
goto err_rollback;
ret = kpatch_verify_symbol_match(func->patch->name,
func->old_addr);
if (ret)
func->old_addr);
if (ret) {
num_funcs = i;
goto err_rollback;
}
/*
* If any other modules have also patched this function, it