diff options
Diffstat (limited to 'kernel/kprobes.c')
-rw-r--r-- | kernel/kprobes.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index c0fa54b276d9..0540948e29ab 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -237,13 +237,9 @@ static int __kprobes collect_garbage_slots(void) | |||
237 | { | 237 | { |
238 | struct kprobe_insn_page *kip; | 238 | struct kprobe_insn_page *kip; |
239 | struct hlist_node *pos, *next; | 239 | struct hlist_node *pos, *next; |
240 | int safety; | ||
241 | 240 | ||
242 | /* Ensure no-one is preepmted on the garbages */ | 241 | /* Ensure no-one is preepmted on the garbages */ |
243 | mutex_unlock(&kprobe_insn_mutex); | 242 | if (check_safety()) |
244 | safety = check_safety(); | ||
245 | mutex_lock(&kprobe_insn_mutex); | ||
246 | if (safety != 0) | ||
247 | return -EAGAIN; | 243 | return -EAGAIN; |
248 | 244 | ||
249 | hlist_for_each_entry_safe(kip, pos, next, &kprobe_insn_pages, hlist) { | 245 | hlist_for_each_entry_safe(kip, pos, next, &kprobe_insn_pages, hlist) { |
@@ -698,7 +694,7 @@ int __kprobes register_kprobe(struct kprobe *p) | |||
698 | p->addr = addr; | 694 | p->addr = addr; |
699 | 695 | ||
700 | preempt_disable(); | 696 | preempt_disable(); |
701 | if (!__kernel_text_address((unsigned long) p->addr) || | 697 | if (!kernel_text_address((unsigned long) p->addr) || |
702 | in_kprobes_functions((unsigned long) p->addr)) { | 698 | in_kprobes_functions((unsigned long) p->addr)) { |
703 | preempt_enable(); | 699 | preempt_enable(); |
704 | return -EINVAL; | 700 | return -EINVAL; |