Commit 1f9c1537 authored by Zheng Yejian's avatar Zheng Yejian Committed by Zheng Zengkai
Browse files

livepatch: Remove redundant copy for old codes

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I53WZ9



--------------------------------

Before commit ec7ce700674f ("[Huawei] livepatch: put memory alloc and
free out stop machine"), procedure of restore codes of old function in
'arch_klp_unpatch_func' is like:
  1. copy old codes which saved in func_node into array 'old_insns';
  2. free memory of func_node;
  3. patch text with old codes in array 'old_insns';

But after above commit, operation of freeing memory of func_node in
procedure 2 is done after 'arch_klp_unpatch_func' succeed. And then
operation of copying old codes in procedure 1 seems redundant, so we
can just remove it.

Suggested-by: default avatarXu Kuohai <xukuohai@huawei.com>
Signed-off-by: default avatarZheng Yejian <zhengyejian1@huawei.com>
Reviewed-by: default avatarKuohai Xu <xukuohai@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 7158e252
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment