summaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorSamasth Norway Ananda <samasth.norway.ananda@oracle.com>2024-05-09 17:34:24 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2024-05-10 11:28:11 -0300
commit09541603462c399c7408d50295db99b4b8042eaa (patch)
treef687f6ec3791e71bd553c2d132e7cdf106484a8f /tools/perf/util
parent230a7a71f92212e723fa435d4ca5922de33ec88a (diff)
downloadlinux-stable-09541603462c399c7408d50295db99b4b8042eaa.tar.gz
linux-stable-09541603462c399c7408d50295db99b4b8042eaa.tar.bz2
linux-stable-09541603462c399c7408d50295db99b4b8042eaa.zip
perf daemon: Fix file leak in daemon_session__control
The open() function returns -1 on error. The 'control' and 'ack' file descriptors are both initialized with open() and further validated with 'if' statement. 'if (!control)' would evaluate to 'true' if returned value on error were '0' but it is actually '-1'. Fixes: edcaa47958c7438b ("perf daemon: Add 'ping' command") Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@oracle.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20240510003424.2016914-1-samasth.norway.ananda@oracle.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
0 files changed, 0 insertions, 0 deletions