[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 <mhiramat@redhat.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>

authored by Masami Hiramatsu and committed by Tony Luck 97075c4b a23fe55e

+4 -3
+4 -3
arch/ia64/kernel/kprobes.c
··· 381 static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) 382 { 383 unsigned int i; 384 - i = atomic_sub_return(1, &kcb->prev_kprobe_index); 385 - __get_cpu_var(current_kprobe) = kcb->prev_kprobe[i].kp; 386 - kcb->kprobe_status = kcb->prev_kprobe[i].status; 387 } 388 389 static void __kprobes set_current_kprobe(struct kprobe *p,
··· 381 static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) 382 { 383 unsigned int i; 384 + i = atomic_read(&kcb->prev_kprobe_index); 385 + __get_cpu_var(current_kprobe) = kcb->prev_kprobe[i-1].kp; 386 + kcb->kprobe_status = kcb->prev_kprobe[i-1].status; 387 + atomic_sub(1, &kcb->prev_kprobe_index); 388 } 389 390 static void __kprobes set_current_kprobe(struct kprobe *p,