[IA64] sn2: add missing put_cpu()
authorTony Luck <tony.luck@intel.com>
Thu, 11 Aug 2011 16:27:54 +0000 (09:27 -0700)
committerTony Luck <tony.luck@intel.com>
Thu, 11 Aug 2011 16:27:54 +0000 (09:27 -0700)
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>
arch/ia64/sn/kernel/sn2/sn_hwperf.c

index 30862c0358cd7a3644f9dd204e203bb2d7efa239..2de41d44266ebc2e860ad185e88cb4ff07e0eab7 100644 (file)
@@ -615,11 +615,15 @@ static int sn_hwperf_op_cpu(struct sn_hwperf_op_info *op_info)
                }
        }
 
-       if (cpu == SN_HWPERF_ARG_ANY_CPU || cpu == get_cpu()) {
-               /* don't care, or already on correct cpu */
+       if (cpu == SN_HWPERF_ARG_ANY_CPU) {
+               /* don't care which cpu */
                sn_hwperf_call_sal(op_info);
-       }
-       else {
+       } else if (cpu == get_cpu()) {
+               /* already on correct cpu */
+               sn_hwperf_call_sal(op_info);
+               put_cpu();
+       } else {
+               put_cpu();
                if (use_ipi) {
                        /* use an interprocessor interrupt to call SAL */
                        smp_call_function_single(cpu, sn_hwperf_call_sal,