perf test: check if cpu_map__new() return NULL
PATCH 1/1 perf test: check if cpu_map__new() return NULL
It looks like we should check if cpus is NULL after
cpus = cpu_map__new(NULL);
in test__open_syscall_event_on_all_cpus().
Signed-off-by Han Pingtian <[email protected]>
--- tools/perf/builtin-test.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-test.c +2 -2
@@ -348,8 +348,8 @@ static int test__open_syscall_event_on_all_cpus(void) } cpus =cpu_map__new (NULL ); -if (threads ==NULL ) { -pr_debug ("thread_map__new\n" ); +if (cpus ==NULL ) { +pr_debug ("cpu_map__new\n" );return -1 ; }
Signature · 1 line
1.7.3.4
Em Sat, Jan 15, 2011 at 07:00:50AM +0800, Han Pingtian escreveu:
Quoted 5 lines
It looks like we should check if cpus is NULL after
cpus = cpu_map__new(NULL);in
test__open_syscall_event_on_all_cpus().
Right, thanks,
- Arnaldo
Commit-ID: 98d77b78504a423fca911a26a17bee00ef2fdda2 Gitweb: http://git.kernel.org/tip/98d77b78504a423fca911a26a17bee00ef2fdda2 Author: Han Pingtian <[email protected]> AuthorDate: Sat, 15 Jan 2011 07:00:50 +0800 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Sat, 22 Jan 2011 19:56:30 -0200
perf test: check if cpu_map__new() return NULL
It looks like we should check if cpus is NULL after
cpus = cpu_map__new(NULL);
in test__open_syscall_event_on_all_cpus().
LKML-Reference: <20110114230050.GA7011@localhost>
Signed-off-by Han Pingtian <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/builtin-test.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
tools/perf/builtin-test.c +3 -3
@@ -347,9 +347,9 @@ static int test__open_syscall_event_on_all_cpus(void) } cpus =cpu_map__new (NULL ); -if (threads ==NULL ) { -pr_debug ("thread_map__new\n" ); -return -1 ; +if (cpus ==NULL ) { +pr_debug ("cpu_map__new\n" ); + goto out_thread_map_delete; }