livepatch/core: Fix where module get and put in different macro
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4SFHQ -------------------------------- Refer to following function procedure, 'obj->mod' is got if not define CONFIG_LIVEPATCH_FTRACE, but it is put if define CONFIG_LIVEPATCH_STOP_MACHINE_CONSISTENCY. If enable state of these two macros changed, reference count of 'obj->mod' would be wrong. klp_register_patch klp_init_patch klp_init_object klp_find_object_module try_module_get <-- !CONFIG_LIVEPATCH_FTRACE module_put <-- CONFIG_LIVEPATCH_STOP_MACHINE_CONSISTENCY klp_free_patch_start klp_free_objects __klp_free_objects module_put <-- CONFIG_LIVEPATCH_STOP_MACHINE_CONSISTENCY So we use CONFIG_LIVEPATCH_STOP_MACHINE_CONSISTENCY uniformly. Fixes: c33e4283 ("livepatch/core: Allow implementation without ftrace") Signed-off-by: NZheng Yejian <zhengyejian1@huawei.com> Reviewed-by: NXu Kuohai <xukuohai@huawei.com> Reviewed-by: NCheng Jian <cj.chengjian@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录