[PATCH -next] perf: fix error return code

From: Wei Yongjun
Date: Thu Apr 11 2013 - 23:06:18 EST


From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>

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 <yongjun_wei@xxxxxxxxxxxxxxxxx>
---
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/