lkml.org 
[lkml]   [2013]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH -next] perf: fix error return code
From
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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@trendmicro.com.cn>
---
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;


\
 
 \ /
  Last update: 2013-04-12 05:21    [W:0.083 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site