Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[IA64] sn2: add missing put_cpu()

sn_hwperf_op_cpu() uses get_cpu() but is missing a corresponding put_cpu().

Reported-by: Thomas Meyer <thomas@m3y3r.de>
Acked-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>

Tony Luck d5d4e028 322a8b03

+8 -4
+8 -4
arch/ia64/sn/kernel/sn2/sn_hwperf.c
··· 615 615 } 616 616 } 617 617 618 - if (cpu == SN_HWPERF_ARG_ANY_CPU || cpu == get_cpu()) { 619 - /* don't care, or already on correct cpu */ 618 + if (cpu == SN_HWPERF_ARG_ANY_CPU) { 619 + /* don't care which cpu */ 620 620 sn_hwperf_call_sal(op_info); 621 - } 622 - else { 621 + } else if (cpu == get_cpu()) { 622 + /* already on correct cpu */ 623 + sn_hwperf_call_sal(op_info); 624 + put_cpu(); 625 + } else { 626 + put_cpu(); 623 627 if (use_ipi) { 624 628 /* use an interprocessor interrupt to call SAL */ 625 629 smp_call_function_single(cpu, sn_hwperf_call_sal,