Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=97075c4b3b7fdd6a083eea075c3a4a601f0d64d8 Commit: 97075c4b3b7fdd6a083eea075c3a4a601f0d64d8 Parent: a23fe55e132cd85108ab55b3fafb4b5060d847c7 Author: Masami Hiramatsu <[EMAIL PROTECTED]> AuthorDate: Fri Jan 18 11:20:46 2008 -0500 Committer: Tony Luck <[EMAIL PROTECTED]> CommitDate: Mon Feb 4 15:09:39 2008 -0800
[IA64] Fix the order of atomic operations in restore_previous_kprobes on ia64 Fix the order of atomic operations to prevent overwriting prev_kprobe[0]. To pop values from stack, we must decrement stack index right AFTER reading values. Signed-off-by: Masami Hiramatsu <[EMAIL PROTECTED]> Signed-off-by: Tony Luck <[EMAIL PROTECTED]> --- arch/ia64/kernel/kprobes.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c index fc4d267..b618487 100644 --- a/arch/ia64/kernel/kprobes.c +++ b/arch/ia64/kernel/kprobes.c @@ -381,9 +381,10 @@ static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) { unsigned int i; - i = atomic_sub_return(1, &kcb->prev_kprobe_index); - __get_cpu_var(current_kprobe) = kcb->prev_kprobe[i].kp; - kcb->kprobe_status = kcb->prev_kprobe[i].status; + i = atomic_read(&kcb->prev_kprobe_index); + __get_cpu_var(current_kprobe) = kcb->prev_kprobe[i-1].kp; + kcb->kprobe_status = kcb->prev_kprobe[i-1].status; + atomic_sub(1, &kcb->prev_kprobe_index); } static void __kprobes set_current_kprobe(struct kprobe *p, - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html