Commit 635c17c2 authored by Namhyung Kim's avatar Namhyung Kim Committed by Ingo Molnar

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: default avatarNamhyung Kim <namhyung@gmail.com>
Acked-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
LKML-Reference: <1284512670-2369-6-git-send-email-namhyung@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 6abded71
...@@ -831,6 +831,7 @@ void __kprobes recycle_rp_inst(struct kretprobe_instance *ri, ...@@ -831,6 +831,7 @@ void __kprobes recycle_rp_inst(struct kretprobe_instance *ri,
void __kprobes kretprobe_hash_lock(struct task_struct *tsk, void __kprobes kretprobe_hash_lock(struct task_struct *tsk,
struct hlist_head **head, unsigned long *flags) struct hlist_head **head, unsigned long *flags)
__acquires(hlist_lock)
{ {
unsigned long hash = hash_ptr(tsk, KPROBE_HASH_BITS); unsigned long hash = hash_ptr(tsk, KPROBE_HASH_BITS);
spinlock_t *hlist_lock; spinlock_t *hlist_lock;
...@@ -842,6 +843,7 @@ void __kprobes kretprobe_hash_lock(struct task_struct *tsk, ...@@ -842,6 +843,7 @@ void __kprobes kretprobe_hash_lock(struct task_struct *tsk,
static void __kprobes kretprobe_table_lock(unsigned long hash, static void __kprobes kretprobe_table_lock(unsigned long hash,
unsigned long *flags) unsigned long *flags)
__acquires(hlist_lock)
{ {
spinlock_t *hlist_lock = kretprobe_table_lock_ptr(hash); spinlock_t *hlist_lock = kretprobe_table_lock_ptr(hash);
spin_lock_irqsave(hlist_lock, *flags); spin_lock_irqsave(hlist_lock, *flags);
...@@ -849,6 +851,7 @@ static void __kprobes kretprobe_table_lock(unsigned long hash, ...@@ -849,6 +851,7 @@ static void __kprobes kretprobe_table_lock(unsigned long hash,
void __kprobes kretprobe_hash_unlock(struct task_struct *tsk, void __kprobes kretprobe_hash_unlock(struct task_struct *tsk,
unsigned long *flags) unsigned long *flags)
__releases(hlist_lock)
{ {
unsigned long hash = hash_ptr(tsk, KPROBE_HASH_BITS); unsigned long hash = hash_ptr(tsk, KPROBE_HASH_BITS);
spinlock_t *hlist_lock; spinlock_t *hlist_lock;
...@@ -859,6 +862,7 @@ void __kprobes kretprobe_hash_unlock(struct task_struct *tsk, ...@@ -859,6 +862,7 @@ void __kprobes kretprobe_hash_unlock(struct task_struct *tsk,
static void __kprobes kretprobe_table_unlock(unsigned long hash, static void __kprobes kretprobe_table_unlock(unsigned long hash,
unsigned long *flags) unsigned long *flags)
__releases(hlist_lock)
{ {
spinlock_t *hlist_lock = kretprobe_table_lock_ptr(hash); spinlock_t *hlist_lock = kretprobe_table_lock_ptr(hash);
spin_unlock_irqrestore(hlist_lock, *flags); spin_unlock_irqrestore(hlist_lock, *flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment