From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnaldo Carvalho de Melo Subject: [PATCH 30/35] perf arm spe: Fix uninitialized record error variable Date: Wed, 15 Aug 2018 12:06:06 -0300 Message-ID: <20180815150611.32080-31-acme@kernel.org> References: <20180815150611.32080-1-acme@kernel.org> Return-path: In-Reply-To: <20180815150611.32080-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org To: Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Kim Phillips , Adrian Hunter , Alexander Shishkin , Dongjiu Geng , Jiri Olsa , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo List-Id: linux-perf-users.vger.kernel.org From: Kim Phillips The auxtrace init variable 'err' was not being initialized, leading perf to abort early in an SPE record command when there was no explicit error, rather only based whatever memory contents were on the stack. Initialize it explicitly on getting an SPE successfully, the same way cs-etm does. Signed-off-by: Kim Phillips Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Dongjiu Geng Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Fixes: ffd3d18c20b8 ("perf tools: Add ARM Statistical Profiling Extensions (SPE) support") Link: http://lkml.kernel.org/r/20180810174512.52900813e57cbccf18ce99a2@arm.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/arch/arm64/util/arm-spe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c index 1120e39c1b00..5ccfce87e693 100644 --- a/tools/perf/arch/arm64/util/arm-spe.c +++ b/tools/perf/arch/arm64/util/arm-spe.c @@ -194,6 +194,7 @@ struct auxtrace_record *arm_spe_recording_init(int *err, sper->itr.read_finish = arm_spe_read_finish; sper->itr.alignment = 0; + *err = 0; return &sper->itr; } -- 2.14.4