[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6f441be9-7731-45dd-a131-39cc2e34dc1a@linaro.org>
Date: Wed, 11 Dec 2024 09:58:00 +0000
From: James Clark <james.clark@...aro.org>
To: Ian Rogers <irogers@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>, Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>, Adrian Hunter <adrian.hunter@...el.com>,
Kan Liang <kan.liang@...ux.intel.com>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] perf inject: Fix use without initialization of local
variables
On 11/12/2024 6:08 am, Ian Rogers wrote:
> Local variables were missing initialization and command line
> processing didn't provide default values.
>
> Fixes: 64eed019f3fc ("perf inject: Lazy build-id mmap2 event insertion")
> Signed-off-by: Ian Rogers <irogers@...gle.com>
> ---
> tools/perf/builtin-inject.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
> index d6989195a061..11e49cafa3af 100644
> --- a/tools/perf/builtin-inject.c
> +++ b/tools/perf/builtin-inject.c
> @@ -2367,10 +2367,10 @@ int cmd_inject(int argc, const char **argv)
> };
> int ret;
> const char *known_build_ids = NULL;
> - bool build_ids;
> - bool build_id_all;
> - bool mmap2_build_ids;
> - bool mmap2_build_id_all;
> + bool build_ids = false;
> + bool build_id_all = false;
> + bool mmap2_build_ids = false;
> + bool mmap2_build_id_all = false;
>
> struct option options[] = {
> OPT_BOOLEAN('b', "build-ids", &build_ids,
Reviewed-by: James Clark <james.clark@...aro.org>
Powered by blists - more mailing lists