diff options
Diffstat (limited to 'kernel/livepatch/patch.c')
| -rw-r--r-- | kernel/livepatch/patch.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/livepatch/patch.c b/kernel/livepatch/patch.c index 825022d70912..0ff466ab4b5a 100644 --- a/kernel/livepatch/patch.c +++ b/kernel/livepatch/patch.c | |||
| @@ -118,7 +118,15 @@ static void notrace klp_ftrace_handler(unsigned long ip, | |||
| 118 | } | 118 | } |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | /* | ||
| 122 | * NOPs are used to replace existing patches with original code. | ||
| 123 | * Do nothing! Setting pc would cause an infinite loop. | ||
| 124 | */ | ||
| 125 | if (func->nop) | ||
| 126 | goto unlock; | ||
| 127 | |||
| 121 | klp_arch_set_pc(regs, (unsigned long)func->new_func); | 128 | klp_arch_set_pc(regs, (unsigned long)func->new_func); |
| 129 | |||
| 122 | unlock: | 130 | unlock: |
| 123 | preempt_enable_notrace(); | 131 | preempt_enable_notrace(); |
| 124 | } | 132 | } |
