Re: [PATCH] perf probe: Fix uninitialized variable

Arnaldo Carvalho de Melo
2024-12-10T13:26:50Z

On Mon, Dec 09, 2024 at 05:12:21PM +0000, James Clark wrote:
> Since the linked fixes: commit, err is returned uninitialized due to the
> removal of "return 0". Initialize err to fix it, and rename err to out
> to avoid confusion because buf is still supposed to be freed in non
> error cases.
>
> This fixes the following intermittent test failure on release builds:
>
> $ perf test "testsuite_probe"
> ...
> -- [ FAIL ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -L foo -V bar (output regexp parsing)
> Regexp not found: \"Error: switch .+ cannot be used with switch .+\"
> ...

Namhyung, I think this should go via perf-tools,

Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com>

- Arnaldo