Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753432Ab3DLDF4 (ORCPT ); Thu, 11 Apr 2013 23:05:56 -0400 Received: from mail-bk0-f52.google.com ([209.85.214.52]:59293 "EHLO mail-bk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751001Ab3DLDFz (ORCPT ); Thu, 11 Apr 2013 23:05:55 -0400 MIME-Version: 1.0 Date: Fri, 12 Apr 2013 11:05:54 +0800 Message-ID: Subject: [PATCH -next] perf: fix error return code From: Wei Yongjun To: a.p.zijlstra@chello.nl, paulus@samba.org, mingo@redhat.com, acme@ghostprotocols.net Cc: yongjun_wei@trendmicro.com.cn, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 995 Lines: 32 From: Wei Yongjun Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function. Signed-off-by: Wei Yongjun --- kernel/events/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index 2427107..7504140 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -6033,8 +6033,10 @@ skip_type: goto got_cpu_context; pmu->pmu_cpu_context = alloc_percpu(struct perf_cpu_context); - if (!pmu->pmu_cpu_context) + if (!pmu->pmu_cpu_context) { + ret = -ENOMEM; goto free_dev; + } for_each_possible_cpu(cpu) { struct perf_cpu_context *cpuctx; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/