Commit e65cefe87beda627c0bfba39b387ee4bffedc93c
Committed by
Linus Torvalds
1 parent
8ed75463b9
Exists in
master
and in
4 other branches
[PATCH] kernel/kprobes.c: fix a warning #ifndef ARCH_SUPPORTS_KRETPROBES
kernel/kprobes.c:353: warning: 'pre_handler_kretprobe' defined but not used Signed-off-by: Adrian Bunk <bunk@stusta.de> Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Acked-by: "Keshavamurthy, Anil S" <anil.s.keshavamurthy@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 1 changed file with 17 additions and 17 deletions Side-by-side Diff
kernel/kprobes.c
... | ... | @@ -344,23 +344,6 @@ |
344 | 344 | spin_unlock_irqrestore(&kretprobe_lock, flags); |
345 | 345 | } |
346 | 346 | |
347 | -/* | |
348 | - * This kprobe pre_handler is registered with every kretprobe. When probe | |
349 | - * hits it will set up the return probe. | |
350 | - */ | |
351 | -static int __kprobes pre_handler_kretprobe(struct kprobe *p, | |
352 | - struct pt_regs *regs) | |
353 | -{ | |
354 | - struct kretprobe *rp = container_of(p, struct kretprobe, kp); | |
355 | - unsigned long flags = 0; | |
356 | - | |
357 | - /*TODO: consider to only swap the RA after the last pre_handler fired */ | |
358 | - spin_lock_irqsave(&kretprobe_lock, flags); | |
359 | - arch_prepare_kretprobe(rp, regs); | |
360 | - spin_unlock_irqrestore(&kretprobe_lock, flags); | |
361 | - return 0; | |
362 | -} | |
363 | - | |
364 | 347 | static inline void free_rp_inst(struct kretprobe *rp) |
365 | 348 | { |
366 | 349 | struct kretprobe_instance *ri; |
... | ... | @@ -577,6 +560,23 @@ |
577 | 560 | } |
578 | 561 | |
579 | 562 | #ifdef ARCH_SUPPORTS_KRETPROBES |
563 | + | |
564 | +/* | |
565 | + * This kprobe pre_handler is registered with every kretprobe. When probe | |
566 | + * hits it will set up the return probe. | |
567 | + */ | |
568 | +static int __kprobes pre_handler_kretprobe(struct kprobe *p, | |
569 | + struct pt_regs *regs) | |
570 | +{ | |
571 | + struct kretprobe *rp = container_of(p, struct kretprobe, kp); | |
572 | + unsigned long flags = 0; | |
573 | + | |
574 | + /*TODO: consider to only swap the RA after the last pre_handler fired */ | |
575 | + spin_lock_irqsave(&kretprobe_lock, flags); | |
576 | + arch_prepare_kretprobe(rp, regs); | |
577 | + spin_unlock_irqrestore(&kretprobe_lock, flags); | |
578 | + return 0; | |
579 | +} | |
580 | 580 | |
581 | 581 | int __kprobes register_kretprobe(struct kretprobe *rp) |
582 | 582 | { |