diff options
author | Namhyung Kim <namhyung@gmail.com> | 2010-09-14 21:04:30 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-09-15 04:44:02 -0400 |
commit | 635c17c2b2b4e5cd34f5dcba19d751b4e58533c2 (patch) | |
tree | 8d24215b1eb84157679c212e40541fcdb9fe9d8c /kernel | |
parent | 6abded71d730322df96c5b7f4ab952ffd5a0080d (diff) |
kprobes: Add sparse context annotations
This removes following warnings when build with C=1
warning: context imbalance in 'kretprobe_hash_lock' - wrong count at exit
warning: context imbalance in 'kretprobe_table_lock' - wrong count at exit
warning: context imbalance in 'kretprobe_hash_unlock' - unexpected unlock
warning: context imbalance in 'kretprobe_table_unlock' - unexpected unlock
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
LKML-Reference: <1284512670-2369-6-git-send-email-namhyung@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/kprobes.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index c53aad5d7e5e..6dd5359e1f0e 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -831,6 +831,7 @@ void __kprobes recycle_rp_inst(struct kretprobe_instance *ri, | |||
831 | 831 | ||
832 | void __kprobes kretprobe_hash_lock(struct task_struct *tsk, | 832 | void __kprobes kretprobe_hash_lock(struct task_struct *tsk, |
833 | struct hlist_head **head, unsigned long *flags) | 833 | struct hlist_head **head, unsigned long *flags) |
834 | __acquires(hlist_lock) | ||
834 | { | 835 | { |
835 | unsigned long hash = hash_ptr(tsk, KPROBE_HASH_BITS); | 836 | unsigned long hash = hash_ptr(tsk, KPROBE_HASH_BITS); |
836 | spinlock_t *hlist_lock; | 837 | spinlock_t *hlist_lock; |
@@ -842,6 +843,7 @@ void __kprobes kretprobe_hash_lock(struct task_struct *tsk, | |||
842 | 843 | ||
843 | static void __kprobes kretprobe_table_lock(unsigned long hash, | 844 | static void __kprobes kretprobe_table_lock(unsigned long hash, |
844 | unsigned long *flags) | 845 | unsigned long *flags) |
846 | __acquires(hlist_lock) | ||
845 | { | 847 | { |
846 | spinlock_t *hlist_lock = kretprobe_table_lock_ptr(hash); | 848 | spinlock_t *hlist_lock = kretprobe_table_lock_ptr(hash); |
847 | spin_lock_irqsave(hlist_lock, *flags); | 849 | spin_lock_irqsave(hlist_lock, *flags); |
@@ -849,6 +851,7 @@ static void __kprobes kretprobe_table_lock(unsigned long hash, | |||
849 | 851 | ||
850 | void __kprobes kretprobe_hash_unlock(struct task_struct *tsk, | 852 | void __kprobes kretprobe_hash_unlock(struct task_struct *tsk, |
851 | unsigned long *flags) | 853 | unsigned long *flags) |
854 | __releases(hlist_lock) | ||
852 | { | 855 | { |
853 | unsigned long hash = hash_ptr(tsk, KPROBE_HASH_BITS); | 856 | unsigned long hash = hash_ptr(tsk, KPROBE_HASH_BITS); |
854 | spinlock_t *hlist_lock; | 857 | spinlock_t *hlist_lock; |
@@ -859,6 +862,7 @@ void __kprobes kretprobe_hash_unlock(struct task_struct *tsk, | |||
859 | 862 | ||
860 | static void __kprobes kretprobe_table_unlock(unsigned long hash, | 863 | static void __kprobes kretprobe_table_unlock(unsigned long hash, |
861 | unsigned long *flags) | 864 | unsigned long *flags) |
865 | __releases(hlist_lock) | ||
862 | { | 866 | { |
863 | spinlock_t *hlist_lock = kretprobe_table_lock_ptr(hash); | 867 | spinlock_t *hlist_lock = kretprobe_table_lock_ptr(hash); |
864 | spin_unlock_irqrestore(hlist_lock, *flags); | 868 | spin_unlock_irqrestore(hlist_lock, *flags); |