diff options
Diffstat (limited to 'kernel/livepatch/transition.c')
-rw-r--r-- | kernel/livepatch/transition.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c index f27a378ad5e1..a4c921364003 100644 --- a/kernel/livepatch/transition.c +++ b/kernel/livepatch/transition.c | |||
@@ -33,8 +33,6 @@ struct klp_patch *klp_transition_patch; | |||
33 | 33 | ||
34 | static int klp_target_state = KLP_UNDEFINED; | 34 | static int klp_target_state = KLP_UNDEFINED; |
35 | 35 | ||
36 | static bool klp_forced = false; | ||
37 | |||
38 | /* | 36 | /* |
39 | * This work can be performed periodically to finish patching or unpatching any | 37 | * This work can be performed periodically to finish patching or unpatching any |
40 | * "straggler" tasks which failed to transition in the first attempt. | 38 | * "straggler" tasks which failed to transition in the first attempt. |
@@ -137,10 +135,10 @@ static void klp_complete_transition(void) | |||
137 | klp_target_state == KLP_PATCHED ? "patching" : "unpatching"); | 135 | klp_target_state == KLP_PATCHED ? "patching" : "unpatching"); |
138 | 136 | ||
139 | /* | 137 | /* |
140 | * klp_forced set implies unbounded increase of module's ref count if | 138 | * patch->forced set implies unbounded increase of module's ref count if |
141 | * the module is disabled/enabled in a loop. | 139 | * the module is disabled/enabled in a loop. |
142 | */ | 140 | */ |
143 | if (!klp_forced && klp_target_state == KLP_UNPATCHED) | 141 | if (!klp_transition_patch->forced && klp_target_state == KLP_UNPATCHED) |
144 | module_put(klp_transition_patch->mod); | 142 | module_put(klp_transition_patch->mod); |
145 | 143 | ||
146 | klp_target_state = KLP_UNDEFINED; | 144 | klp_target_state = KLP_UNDEFINED; |
@@ -620,6 +618,7 @@ void klp_send_signals(void) | |||
620 | */ | 618 | */ |
621 | void klp_force_transition(void) | 619 | void klp_force_transition(void) |
622 | { | 620 | { |
621 | struct klp_patch *patch; | ||
623 | struct task_struct *g, *task; | 622 | struct task_struct *g, *task; |
624 | unsigned int cpu; | 623 | unsigned int cpu; |
625 | 624 | ||
@@ -633,5 +632,6 @@ void klp_force_transition(void) | |||
633 | for_each_possible_cpu(cpu) | 632 | for_each_possible_cpu(cpu) |
634 | klp_update_patch_state(idle_task(cpu)); | 633 | klp_update_patch_state(idle_task(cpu)); |
635 | 634 | ||
636 | klp_forced = true; | 635 | list_for_each_entry(patch, &klp_patches, list) |
636 | patch->forced = true; | ||
637 | } | 637 | } |